Created
August 8, 2013 22:54
-
-
Save tripflex/6189586 to your computer and use it in GitHub Desktop.
menu sections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#count all sections and go through each one to create a menu | |
for ($i = 0; $i < count($sections); $i++) { | |
echo '<li'.($s == $sections[$i] ? ' class="current_page_item">' : '>'); | |
echo '<a href="/'.$sections[$i].'"><span><strong>'.$sectionstitle[$i].'</strong><span class="navi-description">'.$sectionssubtitle[$i].'</span></span></a>'; | |
echo '<ul class="sub-menu">'; | |
# search through current section to build sub-menu items | |
$section = $sections[$i]; | |
foreach ($$section as $submenukey => $submenuvalue){ | |
echo '<li><a href="/'.$section.'/'.$submenukey.'"><span>'.$submenuvalue.'</span></a></li>'; | |
} | |
echo '</ul></li>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment