[TYPO3-english] Re: FLUIDTEMPLATE: render different wraps around Content Elements using CASE key.field = layout
Angelika Krage
a.krage at orangemango.de
Fri Nov 21 15:43:57 CET 2014
Hi all,
I found already how it works.
My basic assumption to place the layout switch configuration inside the FLUIDTEMPLATE variable like I did with the MARKER-templating method was incorrect. As a matter of fact, it simply resides in the top-level tt_content definition.
For those looking for the same, here is my solution:
tt_content.stdWrap.innerWrap.cObject = CASE
tt_content.stdWrap.innerWrap.cObject {
key.field = layout
0 = TEXT
0.value = <div class="test1">|</div>
1 = TEXT
1.value = <div class="test2">|</div>
2 = TEXT
2.value = <div class=<"test3">|</div>
3 = TEXT
3.value = <div class="test4">|</div>
}
The page object is thus also a simple small piece of TypoScript:
page.10 = FLUIDTEMPLATE
page.10 {
format = html
file = fileadmin/templates/layouts/main_layout.html
partialRootPath = fileadmin/templates/partials/
layoutRootPath = fileadmin/templates/layouts/
variables {
pageContent < styles.content.get
pageContent.select.where = colPos = 0
sidebar1 < styles.content.get
sidebar1.select.where = colPos = 1
sidebar2 < styles.content.get
sidebar2.select.where = colPos = 1
}
}
More information about the TYPO3-english
mailing list