FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Display sub-pages of current page?

Feed 3 posts, 2 voices

Avatar
0 posts

Hi,
I have a site structure like this:

home page
>archives
>>2010
>>>article

>>2009
>>>article

>>2008
>>>article

When you go to the archives page, it generates a submenu displaying links to each year (children of “archives”).

I want to write a snippet so that if I click on, e.g, the 2009 page – it will find and display the title of each sub-page. Then if I click on 2008, it will find all 2008 sub-pages, etc..

anyone have any ideas?

 
Avatar
541 posts

try something like this in a your sidebar or wherever you want:

    <ul>
<?php foreach($this->children() as $menu): ?>
      <li><?php echo $menu->link(); ?></li>
<?php endforeach; ?> 
    </ul>