Collapsed menu while visiting submenu page (alias)
9 years 5 months ago #28363
by kiku90
Replied by kiku90 on topic Collapsed menu while visiting submenu page (alias)
In the first prntscr there's a menu which contains position marked red (it's single article menu type).
In the second prntscr there's a menu which contains alias to position from first prntscr. This is a menu which doesn't expand automatically while visiting alias.
In the second prntscr there's a menu which contains alias to position from first prntscr. This is a menu which doesn't expand automatically while visiting alias.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #28382
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Collapsed menu while visiting submenu page (alias)
I have reproduced the issue by my side but I also found that the native joomla menu module has the same issue.
So for now I can not solve this quickly because it would need a global recoding of the active tree ...
the problem is that the parent item is not recognized as being in the active tree, because the tree is based on the original item and not the alias
So for now I can not solve this quickly because it would need a global recoding of the active tree ...
the problem is that the parent item is not recognized as being in the active tree, because the tree is based on the original item and not the alias
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
9 years 5 months ago - 9 years 5 months ago #28395
by kiku90
Replied by kiku90 on topic Collapsed menu while visiting submenu page (alias)
Below is my solution to this problem, for me this's working fine (just place it above "// new method for the active class"):
let me know what do you think?
Code:
if($item->type == 'alias' || $item->type == 'heading') {
$db = JFactory::getDBO();
$q = $db->getQuery(true);
$q->select($db->quoteName('params'));
$q->from($db->quoteName('#__menu'));
$q->where($db->quoteName('parent_id').' = '.$db->quote($item->id));
$db->setQuery($q);
$aliasparams = $db->loadColumn();
foreach($aliasparams as $aliasparam) {
$aliasparamsdecode = json_decode($aliasparam);
if($aliasparamsdecode->aliasoptions == $active_id) {
$item->classe .= ' active';
$item->isactive = true;
}
}
}
let me know what do you think?
Last edit: 9 years 5 months ago by kiku90.
Please Log in or Create an account to join the conversation.
9 years 5 months ago #28396
by ced1870
Joomlack Webmaster and Developer
Replied by ced1870 on topic Collapsed menu while visiting submenu page (alias)
wow...
if it works for you, ok, but I don't think that I will include it immediately. I have to test and find why the joomla system is not working correctly
the best thing would be to open a ticket on the joomla debug, but I'm actually too busy to work deeper on this
if it works for you, ok, but I don't think that I will include it immediately. I have to test and find why the joomla system is not working correctly
the best thing would be to open a ticket on the joomla debug, but I'm actually too busy to work deeper on this
Joomlack Webmaster and Developer
Please Log in or Create an account to join the conversation.
Time to create page: 0.221 seconds