Search the Community
Showing results for tags 'nav'.
-
Hi I'm using PHP for my Navigation Menu, My navbar is in a file named "home.php" looks like this: <ul class="nav navbar-nav navbar-right"> <li><a href="?page=home">Home</a></li> <li><a href="?page=about">About</a></li> <li><a href="?page=services">Services</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="?page=service2">Service 2</a></li> </ul> </ul> Then in my index.php: $page = $_GET['page']; if (!isset($page)) { include('home.php'); } if ($page == "home") { include('home.php'); } if ($page == "about") { include('about.php'); } if ($page == "services") { include('services.php'); } if ($page == "service2") { include('service2.php'); } It all works how I want it to except for one thing; I'd like to add; <li class="active"> To the page that is currently being viewed. How can I do this? Thank you in advance.
-
I'm having trouble including my navigation bar in my web pages using PHP. This is the script i have included in my web page, but it's not working. <?php include("navbar.php"); navBar(); ?> This is the script in navbar.php enclosing my navigation bar. <? function navBar() { ?> NAVIGATION BAR <? } ?> Help is appreciated.
-
Site: http://test2.cmccd.net/ As you can see the navigation links wont lign up right with the nave bar. can any one see whats the problem i spent 2 hours trying to figure it out but it just wont work. CSS .header-wrap, .subheader-wrap, .nav-wrap, .body-wrap, .subfooter-wrap, .footer-wrap {float:left; width:100%; clear:both;} .header, .nav, .body, .subfooter, .footer {width:960px; margin:0 auto;} .header {height:100px;} .sub-header {margin:0 auto; height:38px; width:960px;} .subheader {float:right; width:518px; background:#FFF; border-top:1px solid #000; border-left:1px solid #000; border-right:1px solid #000; padding-top:5px; padding-left:5px; padding-right:5px;} .subheader-content {height:32px; width:518px; background:#8b6a1f; } .nav-wrap{height:44px;} .nav-subwrap {margin:0 auto; height:33px; width:948px; padding-left:5px; padding-top:5px;padding-right:5px;padding-bottom:6px;background:#fff; border-left:1px solid #000; border-right:1px solid #000;} .navtop {width:960px; margin:0 auto;} .navtopborder {float:left; border-top:1px solid #000; width:431px; } .nav{float:left; width:948px; height:33px; background: url(/sites/all/themes/ssccix/files/bg-nav.png) repeat-x;} .navlink {} .navlink li {display:inline;} .navlink a {float:left; font-size:16px; background:#f00; padding:2px 10px; border-right:1px solid #FFF;} .page {float:left; background:#FFF; padding-left:10px; padding-right:10px; padding-bottom:10px; padding-top:5px; border-left:1px solid #000; border-right:1px solid #000; border-bottom:1px solid #000; margin-bottom:10px;} .page-left {float:left; width:220px; padding-right:8px;} .page-content {float:left; width:710px;} .footer {background:#8b6a1f;} PAGE <body style="background:#e8c077 url(/sites/all/themes/ssccix/files/bg-top.png) repeat-x;"> <div id="root" > <div class="header-wrap"> <div class="header"> <div class="logo"><?php print '<a href="/"><img scr="'.$logo.'" alt="'.variable_get('site_name', '').'" /></a>'; ?></div> <?php print render($page['header']); ?></div> </div> <div class="subheader-wrap"> <div class="sub-header"> <div class="subheader"> <div class="subheader-content"><?php print render($page['sub_header']); ?></div> </div> </div> </div> <div class="nav-wrap"> <div class="navtop"> <div class="navtopborder"></div> </div> <div class="nav-subwrap"> <div class="nav"> <div class="navlink"><?php print theme('links', array('links' => $main_menu))?></div> </div> </div> </div> <div class="body-wrap"> <div class="body"> <div class="page"> <div class="page-left"><?php print render($page['sidebar_left']); ?> </div> <div class="page-content"><?php print render($page['content']); ?></div> </div> </div> <div class="subfooter-wrap"> <div class="subfooter"><?php print render($page['sub_footer']); ?></div> </div> <div class="footer-wrap"> <div class="footer"><?php print render($page['footer']); ?></div> </div> </div> </body>