[Typo3] Conditional template loading

media.res | alex widschwendter a.widschwendter at mediares.at
Thu Jun 30 11:30:46 CEST 2005


Vlatko Šurlan wrote:
> Hi list. This is my setup field for my template record on the root page.
> ------------------------------------------------------------
> # Configuring the Auto-Parser:
> 
> plugin.tx_automaketemplate_pi1 {
>   # Read the template file:
>   content = FILE
>   [treeLevel = 0]
>     content.file = fileadmin/template/index.html
>   [else]
>     content.file = fileadmin/template/content.html
>   [end]
> 
>   # Here we define which elements in the HTML that
>   # should be wrapped in subpart-comments:
> 
>   elements {
>     BODY.all = 1
>     BODY.all.subpartMarker = DOCUMENT_BODY
>     HEAD.all = 1
>     HEAD.all.subpartMarker = DOCUMENT_HEADER
>     HEAD.rmTagSections = title
>     TD.all = 1
>   }
> 
>   # Prefix all relative paths with this value:
>   relPathPrefix = fileadmin/template/
> }
> 
> # Default PAGE object:
> page = PAGE
> page.typeNum = 0
> page.10 =< plugin.tx_automaketemplate_pi1
> ------------------------------------------------------------
> 
> But it does not load the correct static template for my pages. The 
> 'content.html' is loaded for all page levels?

you can not use conditions in curly braces. rather go for

[treeLevel = 0]
plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/template/index.html
}
[else]
plugin.tx_automaketemplate_pi1 {
content = FILE
content.file = fileadmin/template/content.html
}
[end]

hth alex



More information about the TYPO3-english mailing list