Collapsed menu while visiting submenu page (alias)

Replied by kiku90 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28289
Native joomla module has "active" class on <li > element, but on <a > it doesn't.

In Accordeon Menu CK module also there's "active" class on <li > element and on <a > there's "isactive" class.
by kiku90

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

Replied by ced1870 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28292
if you have the active class on the <li>, then it should be opened
do you have an url where I can show the issue ?

(anyway this is weird because the mod_menu manage 2 differents way of applying the active state ...)

Joomlack Webmaster and Developer

by ced1870

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

Replied by kiku90 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28297
I made two menu positions in the same menu, one position is alias type, the second is pointing directly to article.
Below are differences between output code in both cases:

this is code from alias type (auto expanding doesn't work):
Code:
<div class="accordeonck "> <ul class="menu" id="accordeonck231"> <li id="item-3426" class="accordeonck item-3426 parent level1 lastItem firstItem" data-level="1"> <a class="toggler toggler_1 " href="javascript:void(0);">Informacje</a> <ul class="content_1" style="display: none;"> <li id="item-3443" class="accordeonck item-3443 active level2 firstItem" data-level="2"> <a class="isactive " href="/dostawa">Dostawa</a> </li> </ul> </li> </ul> </div>


this is code from direct article type (auto expanding is working fine):
Code:
<div class="accordeonck "> <ul class="menu" id="accordeonck231"> <li id="item-3426" class="accordeonck item-3426 active parent level1 lastItem firstItem open" data-level="1"> <a class="toggler toggler_1 isactive " href="javascript:void(0);">Informacje</a> <ul class="content_1" style=""> <li id="item-3445" class="accordeonck item-3445 current active level2 firstItem" data-level="2"> <a class="isactive " href="/informacje-nav/dostawa2">Dostawa</a> </li> </ul> </li> </ul> </div>


As you can see while using alias, some classes are missing in few places. I guess the menu isn't expandig while visiting page because of missing "active" and/or "open" and/or "isactive" classes.

Image from attachment (better quality):
Last Edit:8 years 10 months ago by kiku90
Attachments:
Last edit: 8 years 10 months ago by kiku90.

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

Replied by ced1870 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28300
yes this is the reason
now what I want to know is why this class is not applied to the element :)
do you have a FTP access for me where I can check ?

Joomlack Webmaster and Developer

by ced1870

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

Replied by kiku90 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28304

ced1870 wrote: do you have a FTP access for me where I can check ?

this is a localhost production.

ced1870 wrote: now what I want to know is why this class is not applied to the element :)

As I can see alias menu entry itself has "active" class and "isactive" on href tag, however at the same time, $path variable contains in array only "3383", parent itemid is "3426" and it hasn't got "aliasoptions", so in helper.php around line 167 the "new method for the active class" doesn't applying "active" on parent, because in_array returns false, so it's collapsed.

While using article link menu type, the $path variable contains in array "3426" and "3445", as in example above, parent itemid is "3426", so it is found, in_array returns true and "active" class is applied, so the menu is expanded.

I guess it's all fault of different $path ($base->tree) variable for alias and for other menu positions and the "new method for the active class".
by kiku90

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

Replied by ced1870 on topic Collapsed menu while visiting submenu page (alias)

Posted 8 years 10 months ago #28305
yes the problem comes from the tree, this is what I have seen in the code
but I can not reproduce the issue by my side.
Could you please send me a screenshot or explanations on how to create the menu (2 items shall be sufficient) to reproduce this (item type, alias, etc)

Joomlack Webmaster and Developer

by ced1870

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

Time to create page: 0.691 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 1044 guests and no members online