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?
You are not logged in. Please login or register.
Created a slug and made it hidden. I only want to display the links for the children inside that slug. Can it be done?
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();
}
}
?>Perhaps this helps, you might need to tweak it a bit:
http://www.wolfcms.org/wiki/navbook:leave-out
Posts [ 3 ]