Advertisement
Hide Menu Item from Registered and Special
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.
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.
- easykey
- Joomla! Intern
- Posts: 54
- Joined: Sat Apr 08, 2006 9:59 pm
- Location: Herts, UK
- Contact:
Hide Menu Item from Registered and Special
I know how to hide menu items and content from Public (by assigning them as Registered or Special)
However is there is a way to hide a menu item from Registered or Admin once logged in (i.e. it is only relevant for the public alone)
However is there is a way to hide a menu item from Registered or Admin once logged in (i.e. it is only relevant for the public alone)
I liked Mambo - But I love Joomla
Advertisement
- dhuelsmann
- Joomla! Master
- Posts: 19659
- Joined: Sun Oct 02, 2005 12:50 am
- Location: Omaha, NE
- Contact:
Re: Hide Menu Item from Registered and Special
Can't simply hide an item but can a menu (of course the menu could have been created with just one item and no title and positioned at the bottom of another menu and would look like it was all part of one menu).easykey wrote: I know how to hide menu items and content from Public (by assigning them as Registered or Special)
However is there is a way to hide a menu item from Registered or Admin once logged in (i.e. it is only relevant for the public alone)
toubkal wrote: this cannot be done by joomla administration but can be done by template code
you can have a module position in the template that is set to only show when the visitor is not logged in e.g.in this example, only when a user is not logged in dose the module position "top" get shown on the siteCode: Select all
<?php if ( !$my->id ) {?> <div id="topmod"><?php mosLoadModules ( 'top', -2 ); ?> </div><?php } ?>
Regards, Dave
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
-
- Joomla! Explorer
- Posts: 306
- Joined: Sun Sep 30, 2007 10:18 pm
Re: Hide Menu Item from Registered and Special
I have the same question and it's a difficult one to search for in this forum and google. But I like the template answer. Only thing is -- where exactly would one put that snippet of code?
I also tried as explained to create a new menu item but cannot figure out how to HIDE it from registered view. The options are only allowing me to SHOW, not hide.
Thanks if you can help.
I'm relatively new but love Joomla.
I also tried as explained to create a new menu item but cannot figure out how to HIDE it from registered view. The options are only allowing me to SHOW, not hide.
Thanks if you can help.
I'm relatively new but love Joomla.
- easykey
- Joomla! Intern
- Posts: 54
- Joined: Sat Apr 08, 2006 9:59 pm
- Location: Herts, UK
- Contact:
Re: Hide Menu Item from Registered and Special
I figured it out - Here are more detailed instructions:
1. Create a New Module Position called notreg (in administrator site/ Template Manager / Module Positions in blank position i.e. 28)
2. Create a new Menu called notregmenu (in Menu / Menu Manager)
3. Go to Modules / Site Modules and Publish notregmenu Module with option to not show title and in position notreg
4. Now open template index.php (in site / Template Manager / Site Templates - select and click Edit HTML button
5. Exactly where you insert the following code depends on your template but it needs to be positioned somewhere wher your menu appears - in my template I have placed it just after these three lines...
and here is the code to insert...
I hope this helps
1. Create a New Module Position called notreg (in administrator site/ Template Manager / Module Positions in blank position i.e. 28)
2. Create a new Menu called notregmenu (in Menu / Menu Manager)
3. Go to Modules / Site Modules and Publish notregmenu Module with option to not show title and in position notreg
4. Now open template index.php (in site / Template Manager / Site Templates - select and click Edit HTML button
5. Exactly where you insert the following code depends on your template but it needs to be positioned somewhere wher your menu appears - in my template I have placed it just after these three lines...
Code: Select all
<!-- BEGIN: LEFT COLUMN -->
<div id="ja-col1">
<div class="ja-innerpad">
Code: Select all
<?php if ( !$my->id ) {?>
<div id="notregmenu"><?php mosLoadModules ( 'notreg', -2 ); ?>
</div><?php
} ?>
I liked Mambo - But I love Joomla
-
- Joomla! Explorer
- Posts: 306
- Joined: Sun Sep 30, 2007 10:18 pm
Re: Hide Menu Item from Registered and Special
easykey thank you. It seems that this code will hide the menu once it is clicked and after bringing up the associated component link. However, what I need to do is hide this menu button from the public frontend and have it appear after a user -- any user -- has logged in.
Thanks
Thanks
-
- Joomla! Explorer
- Posts: 306
- Joined: Sun Sep 30, 2007 10:18 pm
Re: Hide Menu Item from Registered and Special
got it working
Thanks!
Thanks!
- SOAMJENA
- Joomla! Ace
- Posts: 1274
- Joined: Thu May 01, 2008 12:36 pm
- Location: QubeSys Technologies Pvt. Ltd ,INDIA
- Contact:
Re: Hide Menu Item from Registered and Special
By this, we can hide a module position. But what about, if we are trying to hide a menu item inside a whole published menu
Any tricks or hacks for this ?
Any tricks or hacks for this ?
Web Design, eCommerce and Software Development
Joomla Premium Extensions,Templates and Support Packages
Joomla Premium Extensions,Templates and Support Packages
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu Sep 24, 2009 1:55 am
Re: Hide Menu Item from Registered and Special
HIDING INDIVIDUAL MENU ITEMS FROM REGISTERED USERS:
I know the else is messy, like I said, i'm not a php guy, but effective none the less.
You can check out it's implementation at http://208.109.224.42/precision3.com/global. A pretty slick custom joomla skin and application also if I don't say so myself.
[Mod edit - removed self-promotional link]
I'm an html guy, the php guys could probably pull this off a little better than me, but here is the solution to removing an individual menu item or list from registered user view. We use the css code visibility:hidden; to hide it and we use width:0px; to get rid of the space it keeps. We have to apply it to the menu items <LI> record, its <a> record, and its <span> record. Drop this code just above your </head> line in the index.php for your template. The number in the class is the menu item number.However is there is a way to hide a menu item from Registered or Admin once logged in (i.e. it is only relevant for the public alone)
Code: Select all
<?php if ( !$my->id ) {}
else {?>
<style>
li.item140,
li.item140 a,
li.item140 a span {
visibility:hidden;
width:0px;
}
</style>
<?php
} ?>
You can check out it's implementation at http://208.109.224.42/precision3.com/global. A pretty slick custom joomla skin and application also if I don't say so myself.
[Mod edit - removed self-promotional link]
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue May 18, 2010 1:10 pm
Re: Hide Menu Item from Registered and Special
Someone needs to create a plugin to allow this function from within the Menu Item Edit functions.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Dec 13, 2011 3:32 pm
- Location: Canada
- Contact:
Advertisement