same level menu

Feed 1 posts, 2 voices

Avatar
2 posts

i found some sub level menu code in forum. but if i’m on last lvl? for example:

site navigation:

-music
—-jazz
—-pop
—-classic
-video
—-fun
—-political

music.php sidebar

—-jazz
—-pop
—-classic

music/jazz.php sidebar

—- empty

i want to do it like this:

music/jazz.php sidebar

—-jazz
—-pop
—-classic

i hope i can understand. how can i do it?

 
Avatar
1493 posts

If I understand — see this post. Summary: have this in the sidebar:

<ul id="nav_sub">
<?php foreach ($this->find('music')->children() as $child): ?>
    <li><?php echo $child->link($child->title, (url_start_with($child->url) ? ' class="current"': null)); ?></li>
<?php endforeach; ?>
</ul>

NOT TESTED. But I hope that gets you started.

Basically, you’re finding a consistent way of calling the “music” children.