This is a templater component that allows to show last few images somewhere within Claromentis. It doesn’t require any additional PHP code to work and can be inserted anywhere in VI template. All configuration is done using tag attributes within template.
Available starting from Claromentis 5.6
Basic usage:
<component class_key="gallery_last_images" album_id="NN">
This will show in row last 5 images from Image Gallery album with ID NN, as specified by album_id attribute.
Full list of parameters:
album_id, required. Image Gallery album ID to take images.
thumb_width, thumb_height. Either of them, or none or both can be specified. Images will be resized to not to exceed defined dimensions. In no limits are specified, default thumbnail size defined in config file will be used. This is 115×115 pixels on clean Claromentis installation.
count, optional. Number of images to show. Default value is 5
layout, optional. Whether to show images in row or in column. Acceptable values are “horizontal”, “vertical” and “custom”. Default is “horizontal” and it will show images in row. If “custom” is specified, template attribute is required.
template, required if layout is custom. Location of template to use to show images. Template structure is described below.
Custom layout allows to define any additional styling, change links, use javascript for slideshow or rotation of images.
To do this, custom html template should be created, put somewhere within Claromentis and its location specified in template attribute. Path to template is entered without leading slash, starting from folder just below interface_.... As an example, location of default templates is “gallery/includes/component_horizontal.html” and “gallery/includes/component_vertical.html”. Templates are usual Claromentis templates, so check this for help with their markup language.
This is a default template for horizontal layout:
<div name="images_list_dsrc" datasrc="">
<div class="Center" style="float: left; padding: 4px 4px 4px 4px">
<a name="image_details_href"><img name="image"></a><br>
<a name="image_details_href"><txt name="title">title</txt></a>
</div>
</div>
The following names are available to use within this template:
images_list_dsrc - main datasource for all images. Make sure tag with this name also has datasrc attribute as in example above.
image - this should be <img ...> tag. Source, dimensions, alt text and title for images will be defined by
PHP code.
title - image title will be put into body of tag with this name
image_details_href - href that leads to image details page. Only
href attribute is set by
PHP code.
image_full_href - href that leads to full-sized image. If used, it’s reasonable to set it to open image in new window.
image_href.href.id - generic tag that defines only image ID in href attribute. Everything else can be defined in template.
Discussion