Hidden menu item

Hidden menu item

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

Edited by: hakumi - Sep-10-17 07:00:03
hakumi
useravatar
Offline
3 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: 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

Code:

foreach ($menu_items as $menuItem)

   $menuNav .= $this->getUserMenuItem($menuItem);

with

Code:

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

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3582 Posts
Website 
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Hidden menu item

Dear Melissa,
I replaced the code in the two positions mentioned, and It's working fine in my case:

Code:

                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,

hakumi
useravatar
Offline
3 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: 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?

Code:

if($menuItem->params->get('menu_show'))

-Melissa

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3582 Posts
Website 
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Hidden menu item

Done, and working fine!

That's great and most clear,

Thank you! current/wink

hakumi
useravatar
Offline
3 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: 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.

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3582 Posts
Website 
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11614
Total Polls:
0
Total Posts:
48805
Posts today:
3
User Info
 
Total Users:
47663
Newest User:
genesis678
Members Online:
1
Guests Online:
1219

Online: 
ramonmedina
Social Stream
SourceCoast Joomla Social Extensions
Friday, 25 May 2018
JFBConnect 8.0 Coming Soon! Stay tuned.
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program