Support Forum

  • Page:
  • 1

Hiding menu item for logged in user.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

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:1]<?php if( !$my->id ) mosLoadModules ( 'top' ); ?>

<?php if( $my->id ){ mosLoadModules ( 'toolbar', -1 );}?>[/code: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's Avatar
  • galapados
  • Free Extensions
  • 3 posts
  • Karma: 0
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers