Layouts
A layout selects which Fluid section is used to render a single slide. The Frontend layout selector on the content element lists the layouts that are available for the chosen renderer.
How rendering works
Two partials are involved per renderer, and only one of them is layout aware:
Resources/renders the slider frame (container, assets, inline JavaScript). It is always rendered with the sectionPrivate/ Partials/<Renderer>. html Default. Adding further sections here has no effect.Resources/renders a single slide. It is rendered with the layout name as the section name.Private/ Partials/ Item/<Renderer>. html
So a layout is a section in the item partial:
<f:section name="Default">
...
</f:section>
<f:section name="Cards">
...
</f:section>
If the selected layout has no matching section in the item partial of the
current renderer, Fluid aborts with
InvalidSectionException: Section "..." does not exist.
Registering a layout
Layouts are registered in page TSconfig under tx_wsslider.templateLayouts.
The key is the section name, the value is the label:
tx_wsslider.templateLayouts.Cards = Cards
Important
There is no addItems here. tx_wsslider.templateLayouts.addItems.Cards
has no effect - the values are read from templateLayouts directly.
(addItems only exists for TCEFORM, which is a different mechanism.)
Because a section only exists in the item partials you provide, restrict the layout to the renderers that actually implement it:
tx_wsslider.templateLayouts.Cards = Cards
tx_wsslider.templateLayouts.Cards.renderers = tinyslider
Without renderers the layout is offered for every renderer. Selecting it on
a renderer whose item partial lacks the section breaks the frontend.
A layout can also be limited to certain columns:
tx_wsslider.templateLayouts.Cards.allowedColPos = 0,1
Adding your own layout
- Add the partial root path of your site package to
plugin.tx_wsslider.view.partialRootPath(or tott_content.ws_slider.partialRootPaths) so your files win over the ones shipped with the extension. - Copy
Item/<Renderer>.of the renderer you use into your own partial root path and add a section named after your layout.html - Register the layout in page TSconfig as shown above and restrict it with
renderersto the renderer you implemented it for.
Layouts shipped with the extension
| Layout | Renderer | Page TSconfig file |
|---|---|---|
| Default | all | built in, always available |
| Cards | tinyslider | EXT: |
The shipped file can be selected in the page properties under Include static Page TSconfig.