[Typo3] GlobalVar - this one *should* be simple, right ... ?
Christopher
bedlamhotel at gmail.com
Wed Dec 14 18:54:38 CET 2005
Hi,
On 12/14/05, Scotty C <superscotty19 at yahoo.com> wrote:
> Hi everyone,
>
> This one's got me puzzled. I've used globalVar before
> to check a condition and it's worked fine. Now, I'm
> using it for another site, but the code won't work!
> The siutation is, I'd like to use 2 different
> templates depending on the page id. Here's my code:
>
> Constants:
> -----------
>
> # default template file
> templateFile = fileadmin/xpressxperience/template.html
>
> # use this template file if pageid = 286
> [globalVar = TSFE:id = 286]
> templateFile = fileadmin/xpressxperience/home.html
> [end]
>
>
> Setup:
> -------
>
<snip>
I don't think that constants are parsed for conditions. Try something
like this instead:
Constants:
--------------------
default_template = fileadmin/xpressxperience/template.html
template_1 = fileadmin/xpressxperience/home.html
Setup:
--------------------
templateFile = fileadmin/xpressxperience/template.html
[globalVar = TSFE:id = 286]
templateFile = fileadmin/xpressxperience/home.html
[global]
Incidentally, if the page with id=286 is the root of the website, you
can try a different kind of condition (that will not require fixing if
the root page of the site ever changes):
[treeLevel = 0]
templateFile = fileadmin/xpressxperience/home.html
[global]
-Christopher
More information about the TYPO3-english
mailing list