test
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • islandview Friend
    #135803

    This should be easy – but I can’t crac k it…..

    How do I set things so my main navigation menu just shows the top level of menu items and no mouseover dropdowns of child menus?????

    Can anyone rescue me with this one!?!?!

    Anonymous Moderator
    #281122

    Dear acbonner,

    Please open Moomenu.class.php file in templates/ja_edenite/ja_menus folder, change functions according to following script:

    [PHP]function beginMenuItems($pid=0, $level=0){
    //echo ‘fdsfdsfsd’;
    if($level==0) echo “<ul id=”ja-cssmenu” class=”clearfix”>n”;
    //else echo “<ul>”;
    }
    [/PHP]
    [PHP]
    function endMenuItems($pid=0, $level=0){
    if($level==0) echo “</ul>n”;
    //else echo “</ul>”;
    }[/PHP]

    [PHP]function genMenuItem($item, $level = 0, $pos = ”, $ret = 0) {
    //if ($level) return parent::genMenuItem($item, $level, ”, $ret);
    //else
    if($level == 0) {
    return parent::genMenuItem($item, $level, $pos, $ret);
    }
    }[/PHP]

    islandview Friend
    #281643

    Hi there – The code you provided to hide the sub-menus worked fine BUT it does create an odd little graphical glitch – see image below.

    For every active sub-menu, a tiny horizontal line appears to the right of the main parent – with many sub-menus this grows and grows!! :((

    Looking at the page code I think it’s because the system is still generating a <li></li> type entry for every item.

    Anyway to stop this happening please?

    Thanks!


    1. menu_issue
    Anonymous Moderator
    #281718

    Dear acbonner,

    Please try to change two function beginMenuItem, endMenuItem to:

    [PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
    $active = in_array($row->id, $this->open);
    $active = ($active) ? ” active” : “”;
    //if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
    //else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
    echo “<li “.(($active) ? “class=”active”” : “”).”>”;
    }
    function endMenuItem($mitem=null, $level = 0, $pos = ”){
    if($level == 0) {
    echo “</li> n”;
    }
    }[/PHP]

    Hope it helps.

    islandview Friend
    #281758

    Sadly still getting the same issue even when using your code above. I’ve refreshed cache and everything like that.

    When I’ve got 2 sub-menus active, the HTML generated using your latest code tweaks is…..

    <li ><a href=”/healthandfitness” class=”menu-item2″ id=”menu41″ title=”Health”><span class=”menu-title”>Health</span></a><li ><li ></li>

    So it’s throwing the extra <li >’s in there still…..

    Any ideas? Thanks

    Anonymous Moderator
    #281856

    Please change following script:

    [PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
    $active = in_array($row->id, $this->open);
    $active = ($active) ? ” active” : “”;
    //if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
    //else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
    echo “<li “.(($active) ? “class=”active”” : “”).”>”;
    }[/PHP]

    To

    [PHP]function beginMenuItem($row=null, $level = 0, $pos = ”) {
    $active = in_array($row->id, $this->open);
    $active = ($active) ? ” active” : “”;
    //if ($level == 0 && @$this->children[$row->id]) echo “<li class=”havechild{$active}”>”;
    //else if ($level > 0 && @$this->children[$row->id]) echo “<li class=”havesubchild{$active}”>”;
    if($level == 0) {
    echo “<li “.(($active) ? “class=”active”” : “”).”>”;
    }
    }[/PHP]

    jay973 Friend
    #281884

    Or you could just set the menu style to either split menu or dropline menu in the template manager.

    Hope this helps.

    Cheers,
    Jason.

    islandview Friend
    #282034

    Thanks so much – This code is working as intended for me – Everything is working now. Thanks so much. 😀

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 3 voices, and was last updated by  islandview 15 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum