0
I have a page selection menu whose final appearance (the current page highlighted with a different color) should be generated dynamically because I want to reuse the same menu for numerous pages, as I will do this dynamic marking?
Screenshot of how the menu should look (with the page I’m highlighted):
Rendered HTML code from static menu:
<div id="left_sidebar" class="col-md-2">
<ul class="nav nav-pills nav-stacked">
<li role="presentation" class="active"><a href="dashboard.php">Dashboard
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="hardware-statistics.php">Hardware Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="hardware-logs.php">Hardware Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="software-statistics.php">Softwares Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="software-logs.php">Softwares Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="site-statistics.php">Site Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="site-logs.php">Site Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="advertises-statistics.php">Advertises Statistics
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="advertises-logs.php">Advertises Logs
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
<li role="presentation"><a href="notices-warnings-errors.php">Notices, Warnings and Errors
<i class="glyphicon glyphicon-chevron-right"></i></a></li>
</ul>
</div>
Note that I make the highlight of the page that I am through a class
OBS1: I’m wearing a Template Engine the Dwoo Template 2.0
to generate the application interface (including menu).
OBS2: I’m using the PHP
to create the data that is passed to the data array (data that is passed to the dwoo object for html fill).
I answered my own question the way I found to solve the problem, if anyone has a better solution publish that I will validate without problems.
– Ricardo