Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreasnymark/5641590 to your computer and use it in GitHub Desktop.
Save andreasnymark/5641590 to your computer and use it in GitHub Desktop.
Creates a dropdown meny, with the current top level parent as the label in the dropdown and displaying all other top level parents.
<?php
// current open
$curr = $page->uid();
?>
<nav role="main">
<ul id="nav-main" class="loop-a-stacked">
<li class="dropdown is-active"><?php echo $pages->findOpen()->menu() ?>
<ul class="dropdown-nav loop-a-stacked">
<?php foreach($pages->not($curr)->not($pages->findOpen()->uid())->visible() AS $p): ?>
<li><a href="<?php echo $p->url() ?>"><?php echo html($p->menu()) ?></a></li>
<?php endforeach ?>
</ul>
</li>
</ul>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment