/mod_cw_contentimage

CW Content Image is a module and plugin that displays the image associated with the current page, whether the page is an article or category page, or if it is a tag page, separating the display of the page's content from the page's image.

Primary LanguagePHP

CW Content Image Module for Joomla

CW Content Image is a module and plugin that display the image associated with the current page, whether the page is an article or category page, or if it is a tag page, separating the display of the page's content from the page's image.

By separating the display of the page's content from the page's image, CW Content Image enables you to more easily customize the layout of your site.

  • Standard Joomla MVC structure
  • Display an article's full text image anywhere on the article page separate from the component output
  • Display a category's image anywhere on the category page separate from the component output
  • Display a tag's image anywhere on the tag page separate from the component output
  • Complete control over which image gets displayed through module parameters
  • Set a default image to display if no article, category, or tag image is available
  • Set which image displays on pages that are not an article, category, or tag page
  • GPL License

Documentation

Add a CW Content Image module to any page(s) on your site

  1. In the Joomla administrator, go to Extensions > Modules and click "New" to add a new module.
  2. Select the CW Content Image module type.

Parameters Explained

  • Default Image: Select or upload an image that will be displayed if no category or article image is available to be displayed.
  • Default Image Alt Text: Enter text to be included in the img alt attribute if the default image is used.
  • Category Page Options: Set the options for this module when renedered on a com_content category page view.
  • Category Page Image: Select which image, if any, to display on the category page.
    • No Image: Do not display an image.
    • Category Image: Display the category image.
    • Default image: Display the default image set above in the parameters.
  • Category Page No Image: Select which image, if any, to display on the category page if there is no category image.
    • No Image: Do not display an image.
    • Default image: Display the default image set above in the parameters.
  • Article Page Options: Set the options for this module when renedered on a com_content article page view.
  • Article Page Image: Select which image, if any, to display on the article page.
    • No Image: Do not display an image.
    • Article Image Display the full article image.
    • Category Image: Display the category image. If no category image exists, the default image will be displayed.
    • Default image: Display the default image set above in the parameters.
  • Article Page No Image: Select which image, if any, to display on the article page if there is no full article image.
    • No Image: Do not display an image.
    • Category Image: Display the category image. If no category image exists, the default image will be displayed.
    • Default image: Display the default image set above in the parameters.
  • Tag Page Options: Set the options for this module when renedered on a com_tags tag page view.
  • Tag Page Image: Select which image, if any, to display on the tag page.
    • No Image: Do not display an image.
    • Tag Image: Display the tag full image.
    • Default image: Display the default image set above in the module parameters.
  • Tag Page No Image: Select which image, if any, to display on the tag page if there is no tag full image.
    • No Image: Do not display an image.
    • Default image: Display the default image set above in the parameters.
  • Contact Page Options: Set the options for this module when renedered on a com_contacts contact page view.
  • Contact Page Image: Select which image, if any, to display on the contact page.
    • No Image: Do not display an image.
    • Contact Image: Display the contact image.
    • Category Image: Display the category image. If no category image exists, the default image will be displayed.
    • Default image: Display the default image set above in the parameters.
  • Contact Page No Image: Select which image, if any, to display on the contact page if there is no tag full image.
    • No Image: Do not display an image.
    • Category Image: Display the category image. If no category image exists, the default image will be displayed.
    • Default image: Display the default image set above in the parameters.
  • Other Page Options: Set the options for this module when renedered on all other pages.
  • Other Pages Image: Select which image, if any, to display on all other pages.
    • No Image: Do not display an image.
    • Default image: Display the default image set above in the parameters.

Creating a Template Override

If you want to override the standard layout, you have to create a template override as follows:

  1. Copy /modules/mod_cw_contentimage/tmpl/default.php to /templates/{YOUR_TEMPLATE}/html/mod_cw_contentimage/default.php
  2. Modify as needed

Note: If you want to have multiple template overrides, you can create multiple copies of default.php, but give it different names. Each new override will be available in as an option in the Alternate Layout parameter in the Advanced parameter tab in the module.

Add a CW Content Image tag to any page(s) on your site

  1. In the Joomla administrator, go to Extensions > Modules and make sure the CW Content Image plugin is enabled.
  2. Add the tag {show_image} to your article anywhere you want to display the content image.
  3. Add the tag {show_title} to your article anywhere you want to display the content title.

Parameters Explained

The parametes for the CW Content Image plugin are the same as the parameters for the CW Content Image module.

Creating a Template Override

If you want to override the standard layout, you have to create a template override as follows:

  1. Copy /plugins/content/cw_contentimage/tmpl/default.php to /templates/{YOUR_TEMPLATE}/html/plg_content_cw_contentimage/default.php
  2. Modify as needed