Submenu with active page is closed when loaded
7 years 1 month ago - 7 years 1 month ago #47578
by cpopolo
Submenu with active page is closed when loaded was created by cpopolo
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.
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: 7 years 1 month ago by cpopolo.
Please Log in or Create an account to join the conversation.
7 years 1 month ago #47579
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Submenu with active page is closed when loaded
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
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
The following user(s) said Thank You: cpopolo
Please Log in or Create an account to join the conversation.
7 years 1 month ago - 7 years 1 month ago #47611
by cpopolo
Replied by cpopolo on topic Submenu with active page is closed when loaded
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:
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
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: 7 years 1 month ago by cpopolo.
The following user(s) said Thank You: ced1870
Please Log in or Create an account to join the conversation.
7 years 1 month ago #47622
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Submenu with active page is closed when loaded
yes you can do that if it works for you

Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds