Skip to content

Instantly share code, notes, and snippets.

@hertsch
Created April 7, 2014 14:10
Show Gist options
  • Save hertsch/10021023 to your computer and use it in GitHub Desktop.
Save hertsch/10021023 to your computer and use it in GitHub Desktop.
Sample for a Bootstrap Navbar with NavbarLinks()
<!-- responsive horizontal navigation with the bootstrap navbar -->
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-example-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- add a home icon and a link to the start page -->
<a class="navbar-brand" href="<?php echo WB_URL; ?>" title="Startseite"><span class="glyphicon glyphicon-home"></span></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-example-collapse">
<?php
/*
* show_menu2() can't show a responsive navbar, so we use the function navbarlinks() which is provided
* by the kitFramework Library https://github.com/phpManufaktur/kfLibrary/tree/master/Helper/bootstrap
*/
if (file_exists(NAVBARLINKS_PATH.'/navbarlinks.php')) {
require_once NAVBARLINKS_PATH.'/navbarlinks.php';
// execute navbarlinks() to generate the menu links
navbarlinks();
}
?>
</div>
</nav>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment