Mini-tut on how to hide buttons from logged in users.

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
jonerator
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Feb 12, 2006 8:36 am

Mini-tut on how to hide buttons from logged in users.

Post by jonerator » Wed May 13, 2009 12:42 am

MODS.. if this is in the wrong section please move, thank you.

It's been difficult to find an easy solution to hide menu items from registered users. Finally, I found a solution that works 100% for me using the MetaMod tool without using any template hacks. The instructions on the metamod page are very vague so I wanted to make it bit more in-depth for this specific use. I'd love to hear if this helps you. Let me know if you find any mistakes and I'll be sure to fix asap.


To hide buttons on your site for users that are logged in do the following:
First thing.. Install this --> http://www.brandonitconsulting.co.uk/mod_metamod/

**In this example I'm using Joomla 1.5.10 and the 'menu' module position.**

1. Create two menus, mine are named 'pubmenu' and 'regmenu'. (Assuming you already have a menu - easiest thing to do is make the new menu in menu manager for reg users. Next, go to the module mgr and create a new menu module for the regmenu menu, mine are called - 'pubmenu' and 'regmenu'. Edit your original menu module and select everything you want your registered users to see and then copy over to the newly created 'regmenu' module or what ever you called yours.) Make sure both menu modules are enabled.

2. Set the "Access Level" to 'public' and "Menu Items" to 'none' for both of your menu modules.

3. In the modules list, locate the one named metamod and copy it. (Only there if you installed the metamod module)

4. Edit newly copied metamod and rename it to metamod_pubmenu, set "Access Level" to 'public' and "Menu Items" to 'All'.

5. On right side in "Module Parameters" "Show Quick Modules To" choose - 'non-logged in users only' then scroll down to the list of available modules and find the "ID" number for your "pubmenu" item and then input that number in the "Quick Module ID Include" field.

6. Copy metamod_pubmenu, edit and rename it to metamod_regmenu. Then, on right side in "Module Parameters" "Show Quick Modules To" choose - 'Logged In Users Only' then input the ID number for your regmenu module in the "Quick Module ID Include" field.

Make sure everything you created is saved and published and all should work brilliantly. Remember that unpublished modules will not show up in the list of available modules while editing the metamod.


JonP - Webmaster
http://www.virtual-aviation.org

cyberk
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Aug 23, 2009 9:34 am

Re: Mini-tut on how to hide buttons from logged in users.

Post by cyberk » Sun Aug 23, 2009 6:41 pm

Hey, excellent post, I actually had this working perfectly last night but now it's bugged..very weird

When logged in, the logged out menu is showing the name but no menu items. It's good that it's showing no items but why is it showing the menu name? Any Ideas?

jonerator
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Feb 12, 2006 8:36 am

Re: Mini-tut on how to hide buttons from logged in users.

Post by jonerator » Sun Aug 23, 2009 7:16 pm

Not sure what your problem is exactly. Maybe try going through the tutorial again and double check you followed everything.

This has been working since May 13th on our site with no problems at all.

When you're logged in, you should only be seeing the logged in menu (regmenu). I just double checked the tutorial and it looks to be accurate to what I have setup.

Make sure that you're building each menu to show only what you want each user type to see. For example, the 'pubmenu' has menu items that the unregistered users will see and 'regmenu' has items that are for registered users only. This is done through the "Menu Item Manager".

If you want, you could email me admin login credentials for your site so I can see what you have done, maybe I'll see the problem.

Good luck.

User avatar
bigspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Apr 15, 2009 1:02 pm
Location: Nottingham, UK
Contact:

Re: Mini-tut on how to hide buttons from logged in users.

Post by bigspring » Wed Sep 16, 2009 12:42 pm

This means that I'd need to maintain two menus though, right? Everytime a menu item is added it will need to be added to the reg menu and viceversa?

jonerator
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Feb 12, 2006 8:36 am

Re: Mini-tut on how to hide buttons from logged in users.

Post by jonerator » Fri Sep 18, 2009 4:50 pm

bigspring wrote:This means that I'd need to maintain two menus though, right?
That's correct, for this to work you need two menus.
bigspring wrote:Every time a menu item is added it will need to be added to the reg menu and viceversa?
Each menu can be completely different, when you add an item to the regmenu there's no need to add it to any other menu. Control what each menu displays through publishing menu items.

Example:

pubmenu could have Home, Register, Log-in, About Us, Links, Support

regmenu could have Home, Downloads, Support, Links, About Us, Profile

Let me know if you have any questions.

User avatar
bigspring
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Wed Apr 15, 2009 1:02 pm
Location: Nottingham, UK
Contact:

Re: Mini-tut on how to hide buttons from logged in users.

Post by bigspring » Mon Sep 21, 2009 9:05 am

cool, thanks for the help

bproffit
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Sun Sep 20, 2009 10:14 pm

Re: Mini-tut on how to hide buttons from logged in users.

Post by bproffit » Thu Mar 17, 2011 9:08 pm

This isn't working for me, and I'm thinking it might be because of my template. It doesn't define a "menu" area as a selectable position. Instead, it populates tabs across the top based on the contents of the Menu Manager entry of type "mainmenu" which Joomla limits to only one. So it looks like this might work if I was willing to change the design and do a separate menu to the left (and lose the great-looking tabs across the tab that was part of the reason I liked this template!), but I don't see a way to make it work. Is there something obvious I'm missing?

devananda
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Mon Apr 04, 2011 12:54 am
Location: S. Korea

Re: Mini-tut on how to hide buttons from logged in users.

Post by devananda » Thu Nov 24, 2011 11:17 pm

HEY! Thanks! I would have never figured that out. Especially to not show the menu on any pages! This was a very helpful post ~ U should contact the people at http://www.metamodpro.com/ and show them this thread! Then they should post a version on their Web site! really......


Locked

Return to “Administration 1.5”