Topic: Display child links only

Created a slug and made it hidden. I only want to display the links for the children inside that slug. Can it be done?

Thumbs up

Re: Display child links only

Sure it can... Explained in steps:

1. Find the page that you created.

2. Request all of its children.

3. For each child, display a link.

(just an example)

<?php

$top = Page::findByUri('your-slug-here');

// Just a check to make sure we actually found it.
if (is_a($top, 'Page')) {
    foreach($top->children() as $child) {
        $child->link();
    }
}

?>
Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

Re: Display child links only

Perhaps this helps, you might need to tweak it a bit:
http://www.wolfcms.org/wiki/navbook:leave-out