mm-active class doesn't apply to parent level tab in mega menu

ccweb's picture
ccweb
Wed, 03/26/2014 - 02:35
#1
mm-active class doesn't apply to parent level tab in mega menu

Hi,

1. a.within our primary menu, we have mega menu for each tab, such as "prospective students".

1. b. when visit child level page under "prospective students", such as "what study suits me?", perent level "prospective students" is still hightlighted as red, which is perfect. and this comes from is_active_link function (i guess), which mean according to path structure. as parent level "prospective students" has path like "/prospectivestudents", and each child level page will have path like "/prospectivestudents/xxxxx". so with our primary menu system, everything works perfectly as needed.

2. a. but we have another level mega menu system such as school level, which will have it own mega menu system like below: the wrong parent level tab being hightlighted. "Home" is the school of education homepage which has path like "/education", and page "soe vision statement" is child page under "about us" which has path like "/education/vision-statement". parent level tab didn't get mm-active class applied correctly according to following parent - child, i guess tab gets hightlighted according to path.

so someone help me out with code, i know it should be some logic code like below, but i dont know how to do it: this should for mega menu, not dropdown tab. some code should be added in theme.inc for theme_megamenu_col_content function to apply mm-active class according to parent-child level.

if (child page is active){

    parent level tab will apply mm-active class in <li> tag

}

also if only with dropdown menu instead of megamenu, parent level tab gets hightlighted, but also "home" tab will apply mm-active class as well, like below: so how to make "home" tab not apply mm-active class.

also i have question about parent-child level pages within megamenu. if one tab such as "about us" has been enabled as megamenu, is "about us" parent level. and page underneath will child level of "about us", is this correct?

i am really appreciate if someone can help this out.

thanks so much!

Ling

cindy's picture
cindy
Thu, 03/27/2014 - 03:49

Hi,
Firstly, thanks for your concern in our product.
Please send us your site as well as admin account via [email protected] to check and fix your problem.
Regards,

ccweb's picture
ccweb
Mon, 04/07/2014 - 01:57

Hi Cindy,the reason mm-active class doesnt apply to parent tab if mega menu is enabled on this tab, is because $path doesn't return any path of subitems if they are in mega menu.
within is_active_link($path, $current), $path only return values of each tabs and path of subitems if tabs are in drop down. but if tab is enabled as mega menu, and any subitem doenst got path value.
my question is how to return value of path of subitems if parent tab is enabled as mega menu.
looking forward to any suggestion!
appreciate for any help!
Ling

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.