daebat Posted October 7, 2009 Share Posted October 7, 2009 I am building a template and found this menu script. The problem is that it doesn't really have any options for subcategories. Is there a way to modify this for that? or should I go with another menu system? <?php $menu = array(); $menu['home'] = 'Home'; $menu['logocatalog'] = 'Logo Catalog'; $menu['logocatalog'] = 'Logo Catalog'; $menu['logocatalog'] = 'Logo Catalog'; $menu['logocatalog'] = 'Logo Catalog'; $menu['logocatalog'] = 'Logo Catalog'; //Add in the format of: $menu['page name'] = 'Page Title'; $title='Home'; //Default title function generateMenu() { global $menu,$default,$title; echo ' <ul>'; $p = isset($_GET['p']) ? $_GET['p'] : $default; foreach ($menu as $link=>$item) { $class=''; if ($link==$p) { $class=' class="selected"'; $title=$item; } echo '<li><a href="?p='.$link.'"'.$class.'>'.$item.'</a></li>'; } echo '</ul>'; } ?> Link to comment https://forums.phpfreaks.com/topic/176857-menu-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.