Page 1 of 1

[solved] Limit selflink to menu level

Posted: Wed Mar 31, 2010 7:29 pm
by klsgfx
I am facing the following challenge:  I have a menu which is four or five levels deep. The frist two levels are displayed with the {menu}-tag as a list on the page. For levels three and deeper I want only a next/previous-link instead of a detailed structure.

Is there any way of limiting cms_selflink to a defined menu-level?

Example:
This is the structure
1
2
- 2.1
- 2.2
- - 2.2.1
- - 2.2.2
- - 2.2.3
- 2.3
etc...


I only want to display

1
2
- 2.1
- 2.2
- 2.3
etc...

And I want to show on 2.2.1 a link to 2.2.2 and on 2.2.2 a link to 2.2.1 and 2.2.3 and on 2.2.3 only a link to 2.2.2

Can anyone help me and point me in the right direction how to accomplish this?
(I hope I could make myself understandable.)

Re: Limit selflink to menu level

Posted: Wed Mar 31, 2010 8:28 pm
by calguy1000
Look at the help for CGSimpleSmarty
it has functions to retrieve the id's of the next and previous sibling.

Re: Limit selflink to menu level

Posted: Wed Mar 31, 2010 10:25 pm
by klsgfx
calguy1000 wrote: Look at the help for CGSimpleSmarty
it has functions to retrieve the id's of the next and previous sibling.
Great, thank you, that did the trick.

Re: [solved] Limit selflink to menu level

Posted: Tue Apr 27, 2010 4:30 pm
by amh
Hi!

Just add {$node->hierarchy} to your menu template and you don't need an extra plug-in.

Best regards Andreas