Quote

We're also available for Custom Joomla Development

Hire us now

Menu2Panel

Is it possible to make a "parent" menu item (i.e. the top level menu item under which any sub menu items sit) not link to an article but automatically 'slide' the to the 2nd level of navigation?

I can achieve the desired effect by making the parent menu item a "text separator" but that messes up my menu on the desktop version

Is there a segment of code I can adjust to create the desired effect?

Many thanks
       
  • Replied by admin on Thursday, March 17 2016, 12:04 AM · Hide· #1
    Hi could you tell me what type of layout you use? Is it the default one or DL menu
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by ant3000 on Thursday, March 17 2016, 08:08 AM · Hide· #2
    Thanks for getting back, it's the default version I'm using.
  •  
  • Replied by ant3000 on Friday, March 18 2016, 09:46 AM · Hide· #3
    Is there a segment of code I can edit in mod_menu2panel > tmpl > default.php?

    Thanks
  •  
  • Replied by admin on Friday, March 18 2016, 02:17 PM · Hide· #4
    How about to just hiding the separator menu on the destop display using css?

    li.divider {
    display:none;}
    @media max-width: 480px {
    li.divider {
    display:block;}
    }
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
  •  
  • Replied by ant3000 on Friday, March 18 2016, 02:37 PM · Hide· #5
    When make the "menu item type" is set as a text separator the parent menu link already disappears from the desktop menu?

    Ideally what I would like to achieve is that when the viewing the mobile version (and using the menu2panel menu) that the parent link uses the href="#menu-s0" (as it would if the menu item type were a text separator) rather than href="/article-title-goes-here"

    Is there a way of adjusting the menu2panel code so that parent items only use href="#menu-s0"
  •  
  • Replied by ant3000 on Friday, March 18 2016, 05:07 PM · Hide· #6
    So I think I might of figured a solution (but you might know of a neater way to implement?)

    mod_menu2panel > assets > query.mmenu.js

    Line 270 change -

    var $btn = $( '<a class="' + cls( 'subopen' ) + '" href="#' + id + '" />' ).insertBefore( $a );
    if ( !$a.is( 'a' ) )
    {
    $btn.addClass( cls( 'fullsubopen' ) );
    }

    to

    var $btn = $( '<a class="' + cls( 'subopen mmenu-fullsubopen' ) + '" href="#' + id + '" />' ).insertBefore( $a );

    Basically I'm forcing the class to always include "menu-fullsubopen"

    Is that an ok way to implement this?
  •  
  •  
    Replied by admin on Saturday, March 19 2016, 01:32 AM · Hide· #7
    Hmm It's hard for me without seeing the website by myself, but adding class name to the <a> tag should be ok.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments