[TYPO3-english] Extend root template for custom pages

bernd wilke t3ng at bernd-wilke.net
Thu Sep 20 14:25:27 CEST 2012


Am 20.09.2012 13:40, schrieb Harish A:
> my page tree structure looks like this:
>
> ROOT
> - PAGE 1
> - PAGE 2
> - PAGE 3
>
> I defined a template in the root page. Which is actually a layout, contains
> header footer and a subpart for main content(´MAINCONTENTSECTION´).
>
> Now for each page I have different html template. I want to extend the root
> template for each page so that the custom html template of each page comes
> inside the ´MAINCONTENTSECTION´ subpart. How to accomplish this with
> typoscript?

just do it:
a) use extension templates on the subpages
b) use typoscript-conditions to build all in one typoscript


while in root you defined something like:
page.10.MAINCONTENTSECTION < styles.content.get

you can replace it in the ext-templates or teh specific conditions with 
something like this:

page.10.MAINCONTENTSECTION >
page.10.MAINCONTENTSECTION = COA
page.10.MAINCONTENTSECTION {
	10 < styles.content.get
	10.wrap = <div id="main">|</div>
	
	20 < styles.content.getRight
	20.wrap = <div id="right">|</div>

	wrap = <div id="variant1">|</div>
}


as always different approches are possible:
if all subpages use the same layout you may use the field "include 
template on next level"

or use conditions regarding the page-ids:
[PIDinRootline = pages-uid, pages-uid, ...]

or better: use conditions on the page-fields layout/BE-layout:
[globalVar = TSFE:page|layout = 1]
[globalVar = TSFE:page|backend_layout = 1]
so an editor can decide for each individual page which layout is 
appropiate (have the default the most used layout, maybe you just need 
to have a special layout for 'Home')

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list