Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
36
site/snippets/treemenu2.php
Normal file
36
site/snippets/treemenu2.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
// nested menu
|
||||
$items = page('press')->children()->published();
|
||||
|
||||
// only show the menu if items are available
|
||||
if($items->count()):
|
||||
|
||||
?>
|
||||
<nav>
|
||||
<ul>
|
||||
<?php foreach($items as $item): ?>
|
||||
<li>
|
||||
<a<?php e($item->isOpen(), ' class="active"') ?> href="<?= $item->url() ?>"><?= $item->title()->html() ?></a>
|
||||
|
||||
<?php
|
||||
|
||||
// get all children for the current menu item
|
||||
$children = $item->children()->published();
|
||||
|
||||
// display the submenu if children are available
|
||||
if($children->count() > 0):
|
||||
|
||||
?>
|
||||
<ul>
|
||||
<?php foreach($children as $child): ?>
|
||||
<li><a<?php e($child->isOpen(), ' class="active"') ?> href="<?= $child->url() ?>"><?= $child->title()->html() ?></a></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue