Get first/last link of mulit-leveled menu
Posted: Sun Jan 10, 2010 7:17 pm
Hi Folks,
as the title says - I need to get the first and last link of each rendered level in a menu.
Example:
-> Parent 1 (class="first")
---> Child 1 (class="first")
---> Child 2
-----> Child Child 1 (class="first")
-----> Child Child 2
-----> Child Child 3
-----> Child Child 4 (class="last")
---> Child 3
---> Child 4 (class="last")
-> Parent 2
-> Parent 3
-> Parent 4 (class="last")
I allready tried it with but this gives me just the last/first link for all links in menu:
-> Parent 1 (class="first")
---> Child 1
---> Child 2
-----> Child Child 1
-----> Child Child 2
-----> Child Child 3
-----> Child Child 4
---> Child 3
---> Child 4
-> Parent 2
-> Parent 3
-> Parent 4 (class="last")
I also asked in IRC yesterday. Sb gave me the hint to work with - but after hours of searching and trying i didnt found a solution 
Maybe theres someone out there how can help me with this issue? That would be great!
as the title says - I need to get the first and last link of each rendered level in a menu.
Example:
-> Parent 1 (class="first")
---> Child 1 (class="first")
---> Child 2
-----> Child Child 1 (class="first")
-----> Child Child 2
-----> Child Child 3
-----> Child Child 4 (class="last")
---> Child 3
---> Child 4 (class="last")
-> Parent 2
-> Parent 3
-> Parent 4 (class="last")
I allready tried it with
Code: Select all
{if $smarty.foreach.submenu.last}
-> Parent 1 (class="first")
---> Child 1
---> Child 2
-----> Child Child 1
-----> Child Child 2
-----> Child Child 3
-----> Child Child 4
---> Child 3
---> Child 4
-> Parent 2
-> Parent 3
-> Parent 4 (class="last")
I also asked in IRC yesterday. Sb gave me the hint to work with
Code: Select all
{if $node->depth > $node->prevdepth}

Maybe theres someone out there how can help me with this issue? That would be great!