if (count($this->pages) > 0) { ?> <?php foreach ($this->pages as $page) { ?> <?php // get page details $category = $this->categories->fetch('id', $page->get('category')); $version = $page->versions()->first(); // page class $cls = ''; if ($page->get('home') == 1) { $cls .= ' root'; } //get file check outs $checkout = \Components\Groups\Helpers\Pages::getCheckout($page->get('id')); ?> <li id="<?php echo $page->get('id'); ?> " class="<?php echo $cls; ?> "> <?php $this->view('item')->set('page', $page)->set('category', $category)->set('group', $this->group)->set('version', $version)->set('checkout', $checkout)->display(); // display page children if ($children = $page->get('children')) { $this->view('list')->set('level', 10)->set('pages', $children)->set('categories', $this->categories)->set('group', $this->group)->display(); } ?>