[TYPO3] Getting parent id in menu

Christopher Torgalson bedlamhotel at gmail.com
Tue May 22 19:39:16 CEST 2007


Hi,

On 5/22/07, Patxi Goitia <pgoitia at euskalnet.net> wrote:
> Hi, I have a page structure like this:
>
> Root (id=1)
>    |
>    |___Recipes (id=2)
>    |     |______ New (id=4)
>    |     |______ Old (id=5)
>    |
>    |
>    |___Food (id=3)
>          |______ Veggies (id=6)
>          |______ Meat (id=7)
>
>
> I want to add a query string to all links under level 1 (aka Part A, or
> Part B), with the id of level 1.
>
> I want the 'Meat' link under 'Food' to have id=7&Section=3
>
> I manage to add the query string to the link, but I'm unable to get the
> correct Id...
>
> This is my TS for level 2 menu
>
> #--------------------------------------
> temp.menu_1.2 = TMENU
> temp.menu_1.2 {
>     expAll=1
>     noBlur=1
>     wrap=<ul> | </ul>
>
>     NO.wrapItemAndSub  = <li> | </li>
>     NO.doNotShowLink = 1
>     NO.before.cObject = TEXT
>     NO.before.cObject {
>        field = nav_title
>        typolink.parameter.field = uid
>        typolink.additionalParams.data = leveltitle:-2
>        typolink.additionalParams.wrap = &section=|
>     }
> }
>
> #--------------------------------------
>
>
> I user leveltitle:-2 as a test, but I have always section=Recipes, even
> in links under 'Food'...
>
> What am I doing wrong ?


Without testing, I'm not sure what you're doing wrong (have you tried
"leveltitle = -1"?), but I notice that you give two different versions
of what you're trying to achieve:

> I want the 'Meat' link under 'Food' to have id=7&Section=3

...and:

> section=Recipes

If it's the first one you want, you should be able to achieve it by
replacing this:

>        typolink.additionalParams.data = leveltitle:-2

...with this:

typolink.additionalParams.field = pid

[the 'pid' field in the page record is the uid of the parent page]

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


More information about the TYPO3-english mailing list