Sub page navigation problems

Feed 4 posts, 2 voices

Avatar
2 posts

Hello all,

I am trying to create a sub navigation for a intranet site I am working on using Frog. Basically what I have is a “who’s who” page which is a child of the home page. This who’s who page has many children as well, and its children have more children. I can figure out how to get a list of the first level of children pages, but I can’t seem to get to the next level of pages. Here is the code I have so far, and works somewhat, but only lists the first child of each sub page.

bc..
<ul>
<?php foreach($this->find(’/whos-who’)->children() as $menus): ?> <li><?php echo $menus->title(); ?></li> <ul> <?php foreach($menus->children() as $menu); ?> <li><?php echo $menu->link(); ?></li>
<?php endforeach; ?>
</ul>

Here is the link to the site so far:
link

Thanks in advance!

 
Avatar
1493 posts

@brettdriscoll: navigating “grandchildren” pages (down three levels) in Frog can be managed several different ways. That’s an interesting menu system you’re using, and I don’t know if the solution I’m most familiar with will work for you — perhaps it will! You can see it at work in the sidebar of my TestFrog site, on the main page and again on the CSS page. (You only see two levels at work there, but it does go down one more level.) You can find the code for it in Frog’s pastebin area.

There is a little more discussion of “sub-navigation” here, which describes a couple more approaches.

It will be interesting to know what solution you come up with!

(Btw – for Textile, I think you need to start your code on the same line as the bc. marker; you only need the bc.. version if the code block itself has empty lines.)

 
Avatar
2 posts

Thanks for the reply David! I will look at your code and see if that can help me. Unfortunately (or fortunately) I don’t really have control over the structure/design of this site. I am supposed to be basing it on our newly redesigned internet site (the site I am working on will be the intranet site). The internet site was designed by a consultant….

BTW I am a mechanical engineer, not a programmer…. I just opened my mouth and said I had web design experience, so now I own this site :-)