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>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/176857-menu-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.