Displays (Pro)
The menu item Theming -> display allows you to define new view modes for your layouts and select the displayers for your fields :
Choose the theme (if you have several) on the top left hand side, the layout on the left menu, and the view mode tab.
Each displayers will have a different set of options to control the front end display.
Displayers/View modes will be saved in project config.
Groups
Displays can be grouped together, you can define as many groups as you want. Groups cannot contain groups.
Field displayers
Some layouts will contain fields that are not Craft fields, they are automatically added by the system, example : "Author" on channels.
Some fields types (Entries, Assets, Users, Categories, Tags, Products and Variants) support the display "Rendered as view mode", when this is selected the display of that element's fields will be controlled by the layout associated to that element and the view mode chosen.
Available displayers defined by the system :
Field type | Displayer | Options |
---|---|---|
Title | Title | html tag, linked to element |
Assets | Links | Label, new tab, download |
Assets | Rendered (volume layout) | View mode |
Assets | Render file | Various options for each kind of file, see below |
Assets | Slick Carousel | View mode, most of slick options |
Category | Label | |
Category | Links | Label, new tab |
Category | Rendered (category layout) | View mode |
Category | Slick Carousel | View mode, most of slick options |
Checkboxes | Label | |
Colour | Default | |
Date | Date | Predefined or custom format |
Date | Date and time | Predefined or custom format |
Date | Time ago | |
Dropdown | Label | |
Email | Email | Output as link |
Entries | Links | Label, new tab |
Entries | Rendered (entry layout) | View mode |
Entries | Slick Carousel | View mode, most of slick options |
Matrix | Default | |
Matrix | Slick Carousel | Most of slick options |
Multi select | Label | |
Number | Default | Decimals, Show prefix/suffix |
Plain text | Full | |
Plain text | Truncated | Limit, ellipsis, link to entry |
Radio buttons | Label | |
Lightswitch | Label | |
Table | Default | |
Tag | Label | |
Tag | Rendered (tag layout) | View mode |
Tag | Slick Carousel | View mode, most of slick options |
Time | Time | Predefined or custom format |
Url | Link | New tab, label |
Users | Default | Show firstname/surname/email, link email |
Users | Rendered (user layout) | View mode |
Users | Slick Carousel | View mode, most of slick options |
File displayers
File displayers control how assets are rendered, you can choose different displayers for different asset types. They can be set when an asset field has the display "Render file", or when the "file" field of a volume layout has the displayer "File" :
Available displayers defined by the system :
File type | Displayer | Options |
---|---|---|
Audio | Html audio | Show controls, muted, autoplay |
HTML | Iframe | Width, height |
HTML | Raw | |
HTML | Code | |
Image | Full image | |
Image | Image transform | Transform or custom, sizes (srcset) |
Javascript | Raw | |
Javascript | Code | |
PHP | Raw | |
PHP | Code | |
JSON | Raw | |
JSON | Code | |
Text | Raw | |
Text | Code | |
Video | HTML Video | Width, height, show controls, muted, autoplay |
XML | Raw | |
XML | Code |
Every file type will also have the displayer "Link to asset" available, with options label, new tab and download.
Caching
Displayer caching is configured by the Content block cache if it's enabled, the html output of each displayers will be stored in cache for faster execution.
Displayer caching uses Craft internal cache tagging system so cache will be automatically invalidated when displayers/fields/view modes are changed.