lindsd1111 Posted July 21, 2014 Share Posted July 21, 2014 I am finalizing the coding from Chapter 3 and cannot get the Account and Admin drop downs to display properly. One possible cause may be that I haven't correctly configured the BASE_URI and BASE_URL settings in the config file. Is there a quick way to check to see that I have configured these properly? Note: I can successfully connect to the DB, and the $_SESSION['user_id'] is set. Thanks! Link to comment Share on other sites More sharing options...
Larry Posted July 21, 2014 Share Posted July 21, 2014 It's probably a problem with your CSS, which would suggest that your mod_rewrite or HTML is causing the problem. Link to comment Share on other sites More sharing options...
lindsd1111 Posted July 22, 2014 Author Share Posted July 22, 2014 Thanks, Larry. I downloaded the CSS files directly from your site, but I'll take a look and see what I can discover... Link to comment Share on other sites More sharing options...
lindsd1111 Posted July 22, 2014 Author Share Posted July 22, 2014 I pulled down a fresh copy of the CSS files from your website, Larry. The dropdown menus for Account and Admin still won't display. Any thoughts of what to check next? Picture: . Link to comment Share on other sites More sharing options...
laurent vignaux Posted July 22, 2014 Share Posted July 22, 2014 Hello Lindsd1111, i see that you have some problem with the dropdown menus. Html structure ? so perhaps, this is the extract of the header.inc.html. This can help you IF you use the Offcanvas ' bootstrap thème good work David <body class="<?php if(isset($page_title)){ echo str_replace(' ','_',$page_title); }else{ echo ''; }?> "> <div class="navbar navbar-fixed-top navbar-inverse" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.php"><img src="../i/logoOR-10.png" alt="recipe" /><b>Recipe</b></a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <?php $pages = array( 'HOME'=>'index.php', 'REGISTER'=>'register.php', 'LOGIN'=>'login.php' ); $this_page = basename($_SERVER['PHP_SELF']); foreach($pages as $key =>$value){ echo '<li'; if($this_page == $value) echo ' class="active"'; echo '><a href="'.$value.'">'.$key.'</a></li>'; }//endF if(isset($_SESSION['user_id'])){ echo '<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">STATUT<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="logout.php">Logout</a></li> <li><a href="renew.php">ReNew</a></li> <li><a href="change_password.php">Change psw</a></li> </ul> </li>'; //if(isset($_SESSION['user_admin'])){ if(isset($_SESSION['user_member']) ){ echo '<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">VOTRE ESPACE <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="author_list_page.php">Liste de vos recettes</a></li> <li><a href="add_page.php">Ajouter une recette</a></li> <li><a href="favorites.php">Favoris</a></li> <li><a href="history.php">Historiques</a></li> </ul> </li>'; } if(isset($_SESSION['user_admin'])){ echo '<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="ad_list_member.php">Liste des membres</a></li> <li><a href="ad_list_page.php">Liste recette</a></li> <li><a href="ad_edit_page.php">Ajouter une recette</a></li> </ul> </li>'; } }?> </ul> <!--search--> <form class="navbar-form pull-right" role="search" > <div class="form-group"> <input type="text" class="form-control input-medium search-query" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Search</button> </form> </div><!-- /.nav-collapse --> </div><!-- /.container --> </div><!-- /.navbar --> Link to comment Share on other sites More sharing options...
lindsd1111 Posted July 23, 2014 Author Share Posted July 23, 2014 Thanks Larry and Laurent for the responses. I'll experiment over the coming days and hope to post up some results here maybe next week. Link to comment Share on other sites More sharing options...
lindsd1111 Posted July 24, 2014 Author Share Posted July 24, 2014 Resolved. The problem was NOT with the CSS. It was that I did not have the bootstrap.min.js file installed correctly. Apparently, Bootstrap dropdown functionality is controlled via JavaScript. Link to comment Share on other sites More sharing options...
Larry Posted July 25, 2014 Share Posted July 25, 2014 Ah...that would do it! Kudos for figuring it out and thanks for letting us know. Link to comment Share on other sites More sharing options...
Recommended Posts