Instantly share code, notes, and snippets.
hagatorn
/ menuAndSubmenu.php
Created
May 9, 2013 21:07
— forked from bastianallgeier/menuAndSubmenu.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php foreach($pages->visible() AS $p): ?> | |
<li> | |
<a<?php echo ($p->isOpen()) ? ' class="active"' : '' ?> href="<?php echo $p->url() ?>"><?php echo html($p->title()) ?></a> | |
<?php if($p->children()->visible()->count()): ?> | |
<ul> | |
<?php foreach($p->children()->visible() AS $item): ?> | |
<li><a<?php echo ($item->isOpen()) ? ' class="active"' : '' ?> href="<?php echo $item->url() ?>"><?php echo html($item->title()) ?></a></li> |