0

Hi
how can i tell the submenu to behave as the main menu

this is the code for the main menu:

 if($script == $url) {
    // if the item in the array is the current page, highlight it
    $menu .= '<li><a style="color:#eb0089" href="#nogo"> '. $text . ' </a></li>';
    } else {
    // else display it as usual link
    $menu .= '<li><a href="' . $url . '">' . $text . '</a></li>';

and this is the code for the submenu:

    // function to draw submenu below the main menu on left side
    function draw_sub_menu($script, $items) {
    // find the correct submenu items to draw
    foreach($items as $url => $val) {
    // if the current page is on the top level (index.php, book.php...)
    if($script == $url) {
    if(isset($val['submenu']) && !empty($val['submenu'])) {
    $submenu = draw_menu($script, $val['submenu']);
    return $submenu;
    } else {
    return '';
    }
    }

the submenu should always be visible and if we click on one item it should receive the style of the main menu:<a style="color:#eb0089" href="#nogo">

Can i do it?
Sorry i'm really new in PHP

Thanks

1
Contributor
1
Reply
2
Views
4 Years
Discussion Span
Last Post by dante123
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.