[TYPO3] Retrieving TS value inside other TS code

Christopher Torgalson bedlamhotel at gmail.com
Tue Nov 7 16:55:33 CET 2006


Hello again,

On 11/7/06, Francois Suter <fsuter at cobweb.ch> wrote:
> Hi Christopher,
>
> Thanks for your answers, but...
>
> > # '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>
> >
> > [snip]
> >
> > 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 { ... }
>
> ...that won't solve my problem. Knowing which part of the page tree
> the current page belongs to is only part of my needs. What I need is
> to know that information for each page that appears in a menu. Some
> menus will be across branches and each page needs to be identified by
> a bullet with the correct color.
>
> Which is why one solution I can think of, is to add a category field
> to the pages table and retrieve it for each menu item with something
> like
>
> lib.somemenu.1.NO.stdWrap2.dataWrap = <li class="{levelfield:-1,
> category, slide}">|</li>
>
> but this means adding this field in the database and adding the field
> in the list of fields that slide ([FE][addRootLineFields] ), which I
> find more cumbersome than if I could just retrieve some value from
> the template, especially since values set for a page are
> automatically inherited by all subpages.
>
> Any other idea anyone?


Ok, I see--I think. But am I right to understand that any given page
in a menu should have the same class as others in the rootline (i.e.
that a level 1 page and all its children need to share the same
class)?

If so, then you should be able to get away with using an existing,
unique field such as uid:

lib.somemenu.1.NO.stdWrap2.dataWrap = <li class="branch_{leveluid:1}">|</li>

Does this help, or have I still misunderstood the problem?


-- 
Christopher Torgalson



More information about the TYPO3-english mailing list