Jump to content

Menu Help


daebat

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.