Topic-icon Hidden menu item

Active Subscriptions:

None
6 years 7 months ago - 6 years 7 months ago #62592 by hakumi
Hidden menu item was created by hakumi
Dear sirs,
I have your SCLogin integrated in our webpage and we try to use with menus that have a submenus with a hidden elements (used to redirect a certain parts and pages of our webpage, not's to use same a link to our guests), but your module show these elements. Is it possible to avoid it? Or it's mandatory that all menu items and submenus placed in the linked menu has active and visible?
In addition, is possible to select a maximum submenus level?
Thank you so much,

P.D. I send you the best wishes due to Irma
Last edit: 6 years 7 months ago by hakumi.
The topic has been locked.
Support Specialist
6 years 7 months ago #62611 by mel
Replied by mel on topic Hidden menu item
If you want to only display menu items at a certain level, we don't have a current way to do this. However, the following code change could get you started with showing just the items on the first level of the menu. You can tweak it to show however many levels you want. If this works for you then I can add an issue to our tracker to add a setting as an enhancement to a future release.

In /modules/mod_sclogin/helper.php:
1. Around line 559, replace
foreach ($menu_items as $menuItem)
   $menuNav .= $this->getUserMenuItem($menuItem);
with
foreach ($menu_items as $menuItem)
{
   if($menuItem->level=="1")
      $menuNav .= $this->getUserMenuItem($menuItem);
}

2. Make the same change in the for loop that was around line 576.

There's not really a concept of a "hidden" menu item. When we attempt to fetch the menu items from the user menu that's selected, Joomla determines the appropriate items to display based on the user's group and the menu items' permissions. Besides limiting to just displaying a certain sublevel of the menu items, there's not much we can do besides advising you to split the menu and submenu up or to create a special menu to use for SCLogin.

-Melissa
The topic has been locked.
Active Subscriptions:

None
6 years 7 months ago #62616 by hakumi
Replied by hakumi on topic Hidden menu item
Dear Melissa,
I replaced the code in the two positions mentioned, and It's working fine in my case:
foreach ($menu_items as $menuItem) 
				{ 
					if($menuItem->level=="1" or $menuItem->level=="2") 
					$menuNav .= $this->getUserMenuItem($menuItem); 
				}

Not's exactly the think I mentioned, but is working fine.
I see that this mod able a limit on a maximum children items level to 1 or 2 (is great to me, because the hidden items has a 3 children's level), but is better if it's possible to manage the "Display in menu" option ( link to see the property I refer ).

Now, I fully enjoy your extension!

Thank you so much!
BR,
The topic has been locked.
Support Specialist
6 years 7 months ago #62617 by mel
Replied by mel on topic Hidden menu item
Ahh, I missed that property when I was looking through the menu items last night. Try the following instead of the searching for the level?
if($menuItem->params->get('menu_show'))

-Melissa
The topic has been locked.
Active Subscriptions:

None
6 years 7 months ago #62618 by hakumi
Replied by hakumi on topic Hidden menu item
Done, and working fine!

That's great and most clear,

Thank you! ;)
The topic has been locked.
Support Specialist
6 years 7 months ago #62619 by mel
Replied by mel on topic Hidden menu item
Thanks for letting me know. It's an easy code change so I'll be checking it in for the next release.
The topic has been locked.