Submenu with active page is closed when loaded

Submenu with active page is closed when loaded was created by cpopolo

Posted 6 years 1 month ago #47578
Edit: From a different post, it was suggested that "always show active submenu = yes" might solve the problem I am having. But I don't see this option in Accordeon CK 1.9.10...

Original Post:
Accordeon CK version 1.9.10 on Joomla 2.5.28 site. I have created a menu and main entry has a submenu. When an item in the submenu is clicked, the page loads but the parent of the submenu is collapsed so that the submenu does not show unless the parent is clicked to expand it. Instead, the desired result is that the submenu containing the active link should be visible when the page loads so that the visitor knows where they are in the menu. I have created the same menu structure with native mod_menu and it behaves correctly. Please see the illustration - the top menu is mod_menu and correctly shows the active submenu; the bottom menu is Accordeon CK where the parent item is collapsed and the submenu does not appear.

Start Level is 2 because the menu is actually one part of a larger menu. End Level is set to All. Menu theme is "simple".

Thanks in advance for any help.
Last Edit:6 years 1 month ago by cpopolo
Attachments:
Last edit: 6 years 1 month ago by cpopolo.

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Submenu with active page is closed when loaded

Posted 6 years 4 weeks ago #47579
Hi
Actually I don't update anymore the Joomla! 2.5 versions
You can compare the helper.php code between the mod_menu and the mod_accordeonck, then check the differences for the active path. You can do the modifications in your module directly
CEd

Joomlack Webmaster and Developer

by ced1870
The following user(s) said Thank You: cpopolo

Please Log in or Create an account to join the conversation.

Replied by cpopolo on topic Submenu with active page is closed when loaded

Posted 6 years 4 weeks ago #47611
Thanks for that tip. For others looking for a solution, here was what I did - I would appreciate a comment from CEd to know that you think this solution is sufficient:

In mod_accordeonck.js, near the very end I added:
Code:
$('a.toggler.isactive')[0].click();

This simulates the click of the active menu which contains the active submenu that should be displayed. This of course assumes that jQuery is loaded otherwise JavaScript getElement should be used (I'm not sure how to fire the click event in that case).

If you can think of any negative side effects for this approach, please let me know!

Thanks

Carl
Last Edit:6 years 4 weeks ago by cpopolo
Last edit: 6 years 4 weeks ago by cpopolo.
The following user(s) said Thank You: ced1870

Please Log in or Create an account to join the conversation.

Replied by ced1870 on topic Submenu with active page is closed when loaded

Posted 6 years 4 weeks ago #47622
yes you can do that if it works for you :)

Joomlack Webmaster and Developer

by ced1870

Please Log in or Create an account to join the conversation.

Time to create page: 0.738 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 665 guests and no members online