[TYPO3] Retrieving TS value inside other TS code

Christopher Torgalson bedlamhotel at gmail.com
Mon Nov 6 18:15:58 CET 2006


Hi Francois,

On 11/6/06, Francois Suter <fsuter at cobweb.ch> wrote:

<snip>

The problem of course will be to determine when to use which constant.
If the site really is divided into branches (e.g. there are a fixed
number of sections, each having its own top-level page), you could do
something like this with TS conditions [1] (if you do it this way,
there's not necessarily any compelling need to use constants unless
they will also be used elsewhere):

# 'PIDinRootline' "...changes something with the template, if the
# page viewed is or is a subpage to" the specified page id:

[PIDinRootline = 15]
# Page 15 is 'lorem' section:
lib.someObject.NO.stdWrap2.wrap = <li class="lorem">|</li>
[PIDinRootline = 20]
# Page 20 is 'ipsum' section:
lib.someObject.NO.stdWrap2.wrap = <li class="ipsum">|</li>
[PIDinRootline = 25]
# Page 20 is 'dolor' section:
lib.someObject.NO.stdWrap2.wrap = <li class="dolor">|</li>
[global]

Finally, simply from a CSS perspective, it's likely that you'd do
better to put the special class or id on the body element like this:

<body id="lorem">

...and style elements in the page this way:

#lorem #menu { ... }
#ipsum #menu { ... }
#dolor #menu { ... }

This will give you the flexibility to change any number of elements in
the page by changing ONLY the body element's id attribute. To do it
this way instead, you'd just put something like this inside your
conditions:

page.bodyTag = <body id="lorem">

...etc.



-- 
Christopher Torgalson


[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/4/1/



More information about the TYPO3-english mailing list