[Typo3] Using TSconfig to change colPos_list based on page layout

Bernhard Kraft kraftb at kraftb.at
Sat Jun 25 13:03:25 CEST 2005


Joseph Mesterhazy wrote:
> # Switch the template from the three-column to the two column if we  are 
> using an alternate layout
> [globalVar = TSFE:page|layout = 1]
> plugin.tx_automaketemplate_pi1 {
> content.file = fileadmin/template/twocolA.html
> }
> [end]

Do you know the "Template Selector  Extension" ? "rltp_tmplselect" ? It's described
in the Modern Template Building (MTB) 1 tutorial.

With it you just need to feed the output of the template selector extension
to the autoparse and you don't need an condition depending on the
layout ... it does that automaticall ...

like:
plugin.tx_automaketemplate_pi1 {
   content < plugin.tx_rlmptmplselector_pi1

just an idea to make it easier (I guess you made that layout-select box yourself ...)

> [If page being viewed in the backend (via 'page') has layout 'normal']
> mod.SHARED.colPos_list=1,0,2
> [else]
> mod.SHARED.colPos_list=1,0
> [end]
> 
> If there is another method of doing this besides TemplaVoila (which  is 
> a bit too automagic for my taste) I would be happy to know. I am a  bit 
> confused why you say "Setting the colPos value by TSConfig will  
> restrict the user to insert content to just one column." because the  
> behavior I see is that it is used to show which columns to display or  
> not in the backend page module.

You said you want to set the "colPos" value depending on the layout. So I guessed you
mean the colPos value of a content element.
Now I know you mean mod.SHARED.colPos_list :)

Well you're right that that will actually work. I always had the same problem that
also content areas which weren't used with that template were also showed ... I din't
find a solution to that.

As I already wrote using TSConfig conditions woule be a solution but it would be necessary
that the page-record (database row) of the actual page is already loaded when the Condition
gets evaluated ...

Unfortunately that's not the case ... bad for you ...

so i know of no other solution ...

sorry for you ...


greets,
Bernhard



More information about the TYPO3-english mailing list