Preview templates
Preview templates let you configure the parameters of images used in attributes. When you apply a template to an attribute of the "Image" or "Group of Images" type, its images are brought to the standard defined in the preview template. This is useful when your project's design is sensitive to image sizes. By configuring a preview template, you change the parameters of the images the end user sees.
To work with preview templates, open the "Settings" section and go to the "Preview templates" subsection. It lists the templates you have already created and has a form for creating new ones.
Creation
In the creation form, specify:
- Name: a non-unique string.
- Marker: a unique string.
Then click "Create".
Configuration
In the list of preview templates, find the one you want to configure and click the gear icon to open edit mode.
A new template already has a set of preview parameters named "default". To add another set, click Add.
You can configure the format for vertical, horizontal, and square images.
In the corresponding forms, fill in:
- Width and Height (Square Side): the dimensions in pixels that the image is fitted into.
- Centering Type: the line that becomes the central axis when the image is scaled down.
Regenerating previews
Changes to template parameters apply only to images uploaded after the change. Files uploaded earlier keep their old previews. To recalculate previews for images that are already uploaded, open the template and click Regenerate previews next to Add. You don't need to upload the files again.
The Regenerate previews button is unavailable while the template has unsaved changes or while regeneration is already running. During regeneration, the progress appears below the button (how many files have been processed out of the total and how many have been updated), and a regeneration indicator appears in the admin panel header.
Default template
Once a template has several sets, you can make one of them the default by selecting its Default Preview checkbox. The CMS uses this set to display previews.
Deletion
In the list of preview templates, find the one you want to delete and click the delete icon .
Confirm the action in the dialog.