live demo
Home arrow Support arrow Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Hiding menu item for logged in user. (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Hiding menu item for logged in user.
#39
Hiding menu item for logged in user. 1 Year, 6 Months ago Karma: 0  
A site Ive been working on has needed a menu item to toggle according to the user state; ie if the user is not logged in then they need to see register on the menu and if they are they need to see profile at the same tab.



So I thought I would post this handy hack that I found on the Joomla forum that worked a treat.http://forum.joomla.org/index.php/topic,132047.0.html



RobInk posted something similar to the following code



Code:

<?php if( !$my->id ) mosLoadModules ( 'top' ); ?> <?php if( $my->id ){ mosLoadModules ( 'toolbar', -1 );}?>
So the way to apply this is to have two menus that are virtually identical and then have them published to the top and toolbar module positions. On the menu published at the toolbar position place all of the member only links and on the top menu post all of the guest only links. Its such a simple piece of code but I think it could be used quite powerfully on some sites. Post edited by: Anthony, at: 2007/05/02 15:10<br><br>Post edited by: Anthony, at: 2007/05/02 15:11
galapados (User)
Fresh Bamboo
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Report to moderator   Logged Logged  
 
The administrator has disabled public write access.  
Go to top Post Reply
Powered by FireBoard
,