Selector¶
You can offer editors different layouts. They can select the layout in the template selector. See
xBlog > [Plugin] > [Template] > External Template
Setup¶
Page TsConfig¶
Using the following Page TsConfig the editor can select the layouts in the xBlog plugin:
tx_xblog.templateLayouts {
1 = A custom layout
99 = LLL:fileadmin/somelocallang/locallang.xlf:someTranslation
}
You can use any number to identify your layout and any label to describe it.
Fluid Template¶
Now it is possible to use a condition in the template to change the layouts, and e.g. load a different partial:
<f:if condition="{settings_flexform_pi1_tmpl_externalTemplate} == 1">
<f:then>
<!-- your layout with the index 1 //-->
</f:then>
<f:else if="{settings_flexform_pi1_tmpl_externalTemplate} == 99">
<!-- your layout with the index 99 //-->
</f:else>
<f:else>
<!-- default xBlog layout //-->
</f:else>
</f:if>
As you can see in this example a different partial is loaded if the layout 99 is used.
See fluid templates at
Resources/Private/View/2ndContent/Templates/Main/List.html
Resources/Private/View/2ndContent/Templates/Main/Single.html