dajare

WolfCMS Layout - Conditional navigation

Feb 21st, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1.  "Wolf" Layout code extract
  2. <!-- THIS CONDITIONAL NAVIGATION COULD GO INTO A SNIPPET / START -->
  3. <?php if ($this->level() > 0) { $parent = reset(explode('/', CURRENT_URI)); $topPage = $this->find($parent); } ?>
  4. <?php if(isset($topPage) && $topPage != '' && $topPage != null) : ?>
  5.  
  6. <?php if ($this->level() > 0) : ?>
  7. <?php if (count($topPage->children()) > 0 && $topPage->slug() != 'articles') : ?>
  8. <h2><?php echo $topPage->title(); ?> Menu</h2>
  9. <ul>
  10. <?php foreach ($topPage->children() as $subPage): ?>
  11.     <li><?php echo $subPage->link($subPage->title, (url_start_with($subPage->url) ? ' class="current"': null)); ?></li>
  12. <?php endforeach; ?>
  13. </ul>
  14. <?php endif; ?>
  15. <?php endif; ?>
  16. <?php endif; ?>
  17. <!-- CONDITIONAL NAVIGATION / END -->
Add Comment
Please, Sign In to add comment