[support] Retrieve item on same menu level

sander-martijn lists at severeddreams.com
Tue Mar 11 22:00:03 UTC 2008


I think there are a couple ways to do this - here's a solution I used in 
page.tpl.php for a theme I was developing recently.

<?php

$trail = _menu_get_active_trail();
$mid = $trail[1];
if($mid != 5){
   $output .= theme('menu_item', $mid);
   $output.= theme('menu_tree',$mid);
   print('<ul class="leftnavmenu">');
   print $output;
   print('</ul>');
}
?>


It does something a bit different than what I think you want to do - it 
gets the current top level and prints all of it's children.  So if you 
were at 1, 1.1 or 1.2 it would print those 3 but none of the things 
under 2.  However this should get you started towards what you need.

.s

Marolijo - Pol maresma wrote:
> How can I do that?
> 
>  > Item 1
>  >> Subitem 1.1
>  >> Subitem 1.2
>  > Item 2
>  >> Subitem 2.1
>  >> Subitem 2.2
> 
> On node template i need to list the item on same level, ex: sub1.1 and 
> sub1.2
> 
> Thank's
> 
> Pol Maresma
> PolNetwork.com / Serveis d'Internet
> msn: marolijo
> 


More information about the support mailing list