[TYPO3] Getting parent id in menu

Tyler Kraft headhunterxiii at yahoo.ca
Tue May 22 20:34:09 CEST 2007


Ok well why don't you look at how to use data in tsref...  I'm pretty 
sure you need to have data = pages:pid

But if you need to haev it in a children and it has a set menu structure 
then just break it up into parts and create the menu that way.
.



Patxi Goitia wrote:
> The two versions of the problem is typo error...
> 
> I want to maintain the original id of the page, but I want to add an 
> extra 'parameter' to control who is the parent.
> 
> pid seems a good start, but I need it in additionalParams and not in field.
> 
> If I do this:
> 
> typolink.additionalParams.data = pid I get a blank 'response', but if 
> work great as you said in field= pid.
> 
> Besides, I need to have the first level's id in all childs:
> 
>  Root (id=1)
>     |
>     |___Food (id=3)
>           |______ Veggies (id=6)
>           |______ Meat (id=7)
>               |
>               |______ Poultry(id=25)
> 
> I need the link to Poultry to be: id=25&section=3
> 
> Thank you
> 
> Christopher Torgalson wrote:
>> 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]
>>


More information about the TYPO3-english mailing list