Skip to content

Instantly share code, notes, and snippets.

@kimisgold
Created December 19, 2013 19:01
Show Gist options
  • Save kimisgold/8044392 to your computer and use it in GitHub Desktop.
Save kimisgold/8044392 to your computer and use it in GitHub Desktop.
Check to see if Omeka main public nav has submenus.
<?php
$nav = new Omeka_Navigation;
$nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);
$nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);
$view_nav = get_view()->navigation()->menu($nav)->getPages();
foreach($view_nav as $page) {
if($page->hasPages()) {
echo 'has submenus';
break;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment