

The layout field in defined the pages table and the field header_layout defined in the tt_content table can be used to provide different templates for content elements and pages.
The first example shows how to customize the contents of the layout/header_layout field in the backend.
Following typoscript has to be put in the page TSConfig:
# Content of the layout select box for pages TCEFORM.pages { layout.altLabels.2 = 3 columns layout.altLabels.1 = 2 columns layout.altLabels.0 = Normal (1 column) } # Content of the layout select box for content elments TCEFORM.tt_content { header_layout.altLabels.2 = Grey background header_layout.altLabels.1 = Green background header_layout.altLabels.0 = Normal(white) }
Thanks to this snippet you can select 3 different designs for pages and content elments.
Now the typoscript setup for the new layouts has to be done:
For pages it works like that:
[globalVar=TSFE:page|layout=1] page.10.template.file= fileadmin/templates/template_2column.html [global] [globalVar=TSFE:page|layout=2] page.10.template.file= fileadmin/templates/template_3column.html [global]
In this example the html template is switched depending on the selected layout.
Certainly we could also change the css file depending on the layout:
[globalVar=TSFE:page|layout=1] page.includeCSS.layout= fileadmin/templates/style_2.css [global] [globalVar=TSFE:page|layout=2] page.includeCSS.layout= fileadmin/templates/style_3.css [global]
The layout for the content elements is defined this way:
page.10=TEMPLATE page.10{ template = FILE # include the template (html file with subparts) template.file = fileadmin/templates/template.html # subpart on wich we work workOnSubpart = DOCUMENT subparts{ CONTENT<styles.content.get CONTENT.renderObj.stdWrap.innerWrap.cObject=CASE CONTENT.renderObj.stdWrap.innerWrap.cObject{ key.field = header_layout default=TEXT default.value=<div class="white">|</div> 1=TEXT 1.value=<div class="green">|</div> 2=TEXT 2.value=<div class="grey">|</div> } } }




But what to do if I'd like more than 4 Layout presets? Must be very simple, and undocumented,as usual...
thanks in advance
Corvinus
We will put in that feature, when we relaunch the site.
There is no need that you fill, the email field.
For now i changed your email to the same email as in your last post.
TCEFORM.pages.layout.addItems
TCEFORM.pages.layout.removeItems
As described in TSconfig Quick reference - click on the icon with TS book beside the TSconfig field and go to:
TCEFORM.[tablename].[field].types.[type]
Add comment