[TYPO3] Getting parent id in menu
Christopher Torgalson
bedlamhotel at gmail.com
Tue May 22 20:37:40 CEST 2007
Hi,
On 5/22/07, Patxi Goitia <pgoitia at euskalnet.net> wrote:
> I repost a question of few days ago... It's a problem of shortcuted
> pages not inheriting 'caller' contants:
>
> ---
>
> Hi, I have this structure of pages
>
> Root
> |
> |___Part A
> | |______ News
> | |______ Recipes [Shortcut to "Common content\Recipes"]
> |
> |
> |___Part B
> | |______ News
> | |______ Recipes [Shortcut to "Common content\Recipes"]
> |
> |
> |___Common content
> |______ Recipes
>
>
> Part A and Part B have each a value defined in template\constant named
> BackgroundColor
>
> Can I specify in Common content\Recipes that value BackgroundColor is
> the callers (father) value ?
>
> Now, when I go to Part A\News or Part B\News, I have {$BackgroundColor}
> instead of having the color value for each 'father' page...
I'm not sure without testing, but I think there may be an easier way then:
1. You can use conditions in the constants field of TS templates
2. There is a nice condition called PIDinRootline that tests whether a
page is in the 'rootline' of a given page id (I'd give you a link, but
the TSref).
Try something like this--it should be simple enough to maintain as
long as there aren't dozens of pages where this needs to happen:
[PIDinRootline=1]
constant = value1
[PIDinRootline=2]
constant = value2
[PIDinRootline=3]
constant = value3
[global]
--
Christopher Torgalson
http://www.typo3apprentice.com/
[1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/4/1/#id3526867
More information about the TYPO3-english
mailing list