Preview Templates
Preview templates allow you to configure the image parameters used in attributes. By applying a template to an attribute of type "Image" or "Image Group," you will get images standardized according to the specifications set in the preview template. This is convenient if your project's design is sensitive to image sizes. By configuring the preview template, you can modify the image parameters that the end user will see.
To get started with preview templates, open the "Settings" section and then navigate to the "Preview Templates" subsection. This section contains a list of already created templates, as well as a form for creating new ones.
Creation
In the creation form, specify:
- Name - A non-unique string.
- Marker - A unique string.
After filling in the details, click the "Create" button.
Configuration
Select the preview template you want to configure from the general list and click on the gear icon to enter edit mode.
To create preview parameters, click the "Add" button.
You can configure the format for vertical, horizontal, and square images.
In the corresponding forms, fill in:
- Width and Height (Square Side) - Dimensions in pixels that the image will fit into.
- Centering Type - The line that will become the central axis when compressing the image.
Regenerating Previews
Changing the template parameters only affects images uploaded after the change: previously uploaded files retain their old previews. To recalculate the previews of already uploaded images, open the template and click the Regenerate previews button next to the Add button. You do not need to re-upload files.
The Regenerate previews button is unavailable while there are unsaved changes in the template, as well as while regeneration is already in progress. During the process, progress is displayed under 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 header of the admin panel.
Default Template
After creating several sets in one template, you can switch the default template. It is used for displaying previews in the CMS.
Deletion
Select the preview template you want to delete from the general list and click on the delete icon to enter edit mode.
Confirm the action in the dialog box.