1 2015-07-30 03:27:03

Topic: Get children pages does not work

Hi hope someone can help me with the problem.
This code:

<?php $pages = Page::children('page'); ?>
<?php foreach($pages as $page) { ?>
    <a href="<?php echo Site::url().'about/'.$page['slug']; ?>"><?php echo $page['title']; ?></a>
<?php } ?>

from here http://monstra.org/documentation/theme-template-tags
says that i can get the list of children of the page (Get children pages for a specific parent page)

So i put this code in my template for my page Details, since i have like 7 childrens for details page, but it does not work it show nothing at the place i added that code, and there is no error even on DEV mode

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Get children pages does not work

nvm has to be this code =/
works well

                        <?php $pages = Page::children('details'); ?>
                        <?php foreach($pages as $page) { ?>
                            <a href="<?php echo Site::url().'/details/'.$page['slug']; ?>" class="list-group-item"><?php echo $page['title']; ?></a>
                        <?php } ?>
(с) Roman Art
So far So good wink

RomanArt's Website