[TYPO3] Use template-name (template-object) as variable in TS (with TemplaVoila)

Christopher Torgalson bedlamhotel at gmail.com
Wed Oct 3 20:26:25 CEST 2007


Hi Bert,

On 10/3/07, Bert Hiddink <hiddink at bendoo.com> wrote:
> Hello!
>
> Is there a way to use the name of the page-template name in use in order
> to put a condition with TS.
>
> This example works OK:
>
> [treeLevel = 1]
> page.headerData.5 = IMG_RESOURCE
> page.headerData.5.file {
>    import.data = levelmedia: 2,slide
>    import = uploads/media/
>    import.listNum = 0
>   # width = 270
>   # height= 300
> }
> ....
> )
> [end]
>
>
> Now I want something like:
>
> [templateName = Home]
> page.headerData.5 = IMG_RESOURCE
> page.headerData.5.file {
>    import.data = levelmedia: 2,slide
>    import = uploads/media/
>    import.listNum = 0
>   # width = 270
>   # height= 300
> }
> ....
> )
> [end]
>
> With 'templateName' I refer to a TemplaVoila template-object.
>
> Hope I made myself clear. Many thanks in advance!!!



I don't know of any way that that would be possible, but you can use
the TS datatype 'gettext' to retrieve information about the current
template (or the last template in the rootline). Check the TV
newsgroup for a thread titled "how to map a body attribute" for a
working example of how to change the body tag based on the current TV
template.


-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list