[TYPO3] Multiple Templates on One Site

Tyler Kraft headhunterxiii at yahoo.ca
Thu Jul 27 08:05:51 CEST 2006


No real tutorial but the important stuff is below

Once you know how to reference in a html template then all you do is 
change one line for various set ups. In the case below I'm just changing 
the way various columns get wrapped depending on the layout option. You 
can put anything you want in there really. If you consistently use the 
same marks for the html templates then just simply have one line of ts 
that changes the template html that is used depending upon the layout 
chosen - read up on this in the tsref, and typoscript syntax documents


	#default layout incae other pages dont get a layout for some reason
	temp.maincol.wrap = <div id="innermaincol" class="r500">|</div>
	temp.rhcol.wrap = <div id="rhcol" class="w500" >|</div>

[globalVar = TSFE:page|layout=0]
	#default layout again
	temp.maincol.wrap = <div id="innermaincol" class="r500">|</div>
	temp.rhcol.wrap = <div id="rhcol" class="w500" >|</div>

[globalVar = TSFE:page|layout=1]
	temp.maincol.wrap = <div id="innermaincol" class="r300">|</div>
	temp.rhcol.wrap = <div id="rhcol" class="w300 nborder">|</div>


[global]


Then to rename the options just use the below ts in the page tsconfig 
(from tsconfig document, where you can also read on how to add options)

TCEFORM.pages.layout.altLabels.0 = 300px/White/Img Border
TCEFORM.pages.layout.altLabels.1 = 500px/White/no Img border


hth



Werner Weissenfels wrote:
> Tyler Kraft wrote:
>> well if you create each of your different templates in html/css and 
>> get them using the same marks then there is an easy way that I quite 
>> like.
>>
>> you show the user three columns in the BE to edit and let them decided 
>> which layout they want, and let them add content into the right and 
>> main column for that type of layout and into all three columns for 
>> that type of layout, etc. Then if they go to edit the page header, and 
>> change the page type from standard to advanced they will find a layout 
>> selector box.
>>
>> You can also add more options (and of course rename options there if 
>> you want) for the layout if you need more than four.
>>
>> then in your typoscript template just put a few simple conditions in 
>> to check this selector and use a different html template depending on 
>> this selector box.
>>
>> done, and all the ts work should atkea bout 30min.
>>
>> handling the navigation can be done using the same selector box check 
>> - simple really. Now if you co this route you will need to look at 
>> tsref on conditionals and the globalVar section, and also tsconfig to 
>> add/rename these options if you want to do that.
>>
> 
> Tyler,
> what you write sounds really interesting and is actually something I 
> have been looking for.
> Is there any tutorial or documentation that describes the details 
> necessary to set it up that way?
> What may be really simple for you can be quite complicated for me as a 
> beginner when not knowing what exactly to do.
> 
> Thanks,
> Werner



More information about the TYPO3-english mailing list