FluidTYPO3: Multiple frontend layouts

raw

Resources/Private/Layouts/Multiple.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
     xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
     data-namespace-typo3-fluid="true"
>
    <f:layout name="Content" />
    <f:if condition="{settings.layout}">
      <f:then>
        <f:render section="{settings.layout}" />
      </f:then>
      <f:else>
        <f:render section="Main" />
      </f:else>
    </f:if>
</html>
 
raw

Resources/Private/Templates/Content/Element.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
     xmlns:flux="http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers">
 
  <f:layout name="Multiple" />
 
  <f:section name="Configuration">
    <flux:form id="test" options="{group: 'FCE'}">
      <flux:field.select name="settings.layout" items="Main1,Main2" label="Layout"/>
    </flux:form>
  </f:section>
 
  <f:section name="Main1">
    <h2>Layout 1</h2>
  </f:section>
 
  <f:section name="Main2">
    <h2>Layout 2</h2>
  </f:section>
</html>
 
Christian Weiske Christian Weiske
owner

History