Fluid Layout Condition

Author:
Kategorie:
TYPO3
Beitrag vom:
TYPO3 FLUID Template
TYPO3 FLUID Template

Verschiedene Bereiche des FLUIDTEMPLATE abhängig von Bedingungen füllen.

Original Artikel:
FLUIDTEMPLATE mit Backend Layouts

http://wiki.t3easy.de/extbase-und-fluid/fluidtemplate-mit-backend-layouts/

Typoscript:

 page.10 = FLUIDTEMPLATE
 page.10 {
 	file = {$Private}/Templates/Page.html
 	partialRootPath = {$Private}/Partials/
 	layoutRootPath = {$Private}/Layouts/
 	variables{
 		layout = TEXT
 		layout.data = levelfield:-2,backend_layout_next_level,slide
 		layout.override.field = backend_layout
 
 		contentCenter < styles.content.get
 		contentLeft < styles.content.get
 		contentLeft.select.where = colPos = 1
 		contentRight < styles.content.get
 		contentRight.select.where = colPos = 2
 
 		footer < lib.footer
 	}
 } 

Fluid Template mit Condition:

 <f:if condition="{layout} == 1">
 	<f:render partial="TwoCols" arguments="{contentLeft:contentLeft, contentRight:contentRight}" />
 </f:if>
 <f:if condition="{layout} == 2">
 	<f:render partial="ThreeCols" arguments="{contentLeft:contentLeft, contentCenter:contentCenter, contentRight:contentRight}" />
 </f:if>
 
 <f:comment>
 	Oder direkt im Partial Namen ohne if
 </f:comment>
 <f:render partial="Layout{layout}" arguments="{contentLeft:contentLeft, contentCenter:contentCenter, contentRight:contentRight}" />
 <f:comment>
 	Dadurch wird das Partial "Layout.html" verwendet, wenn gar kein Backend Layout zugewiesen wurde, oder "Layout1.html" für BE-Layout 1 und "Layout2.html" für BE-Layout 2.
 </f:comment>
 

Seite teilen

Der Beitrag: Fluid Layout Condition, aus der Rubrik TYPO3 hat dir gefallen?