Configuration instructions for the plugins "Images for category".
Settings plugins.
- plugins activity - enables (disables) the plugins functionality.
- Caching - uses caching algorithms supported by the Shopy-Script application (memcache, xcache...).
- Add image to OpenGraph micro-partition - adds the image attribute to the OpenGraph micro-partition of the category page.
- Image identifier to display - the image with the specified identifier will be displayed in the OpenGraph micro-partition.
Image group table.
To add a group, click the "Add category" link and fill in the following fields:
- Name - the textual name of the image group (will be displayed when editing the category).
- Identifier - the textual identifier of the group used to call it in themes (valid characters are a-z and 0-9).
- Width - the maximum width for image cropping. If the value is empty (zero), image cropping by width will be proportional to the given height.
- Height - the maximum height for image cropping. If the value is empty (zero), image cropping by height will be proportional to the given width.
If both height and width values are empty, the original image will be used.
Helpers for use in themes.
- {$images = shopSkcatimageHelper::getImages()} - retrieves all images as an array.
- {$images = shopSkcatimageHelper::getImages($category.id)} - retrieves all images from the category as an array, where $category.id is the id of the category.
- {$image = shopSkcatimageHelper::getImages($category.id, $group_name)} - retrieves a specific category image as a link, where $category.id is the category identifier and $group_name is the textual identifier of the image group from plugins settings.
Example:
1. {$image = shopSkcatimageHelper::getImages($category.id, 'banner')} - the $image variable will contain the link to the image with group identifier banner for the category whose identifier is stored in the $category.id variable.
2. Then insert the link into the image tag:
<img src="{$image}" />