This is the function that I am using to display the Codecrypt nav.
Code: Select all
// Function to show the header of the page
function pageHeader($navActive) {
// This is the array of nav items
$this-> _dNavList[0] = 'home';
$this-> _dNavList[1] = 'forums';
$this-> _dNavList[2] = 'articles';
$this-> _dNavList[3] = 'tutorials';
$this-> _dNavList[4] = 'resources';
$this-> _dNavList[5] = 'info';
// Starts of the header, opens up the nav list
print '
<div id="header">
<img src="images/banner.gif" border="0" />
<!-- Navigation goes here -->
<div id="nav">
<ul id="navlist">
';
// Code for printing the nav, selecting the active one
$x = 0;
while ($x < 6) {
if ($navActive = $this-> _dNavList[$x]) {
print '
<li class="current"><a href="#" class="active">'. $this-> _dNavList[$x] .'</a></li>
';
}
else {
print '
<li><a href="#">'. $this-> _dNavList[$x] .'</a></li>
';
}
$x = $x + 1;
}
// Close the list and the divs
print '
</ul>
</div>
</div>
';
}Code: Select all
$layout->pageHeader('home');Code: Select all
<div id="nav">
<ul id="navlist">
<li class="current"><a href="#" class="active">home</a></li>
<li><a href="#">forums</a></li>
<li><a href="#">articles</a></li>
<li><a href="#">tutorials</a></li>
<li><a href="#">resources</a></li>
<li><a href="#">info</a></li>
</ul>
</div>Code: Select all
<div id="nav">
<ul id="navlist">
<li class="current"><a href="#" class="active">home</a></li>
<li class="current"><a href="#" class="active">forums</a></li>
<li class="current"><a href="#" class="active">articles</a></li>
<li class="current"><a href="#" class="active">tutorials</a></li>
<li class="current"><a href="#" class="active">resources</a></li>
<li class="current"><a href="#" class="active">info</a></li>
</ul>
</div>


