views:

196

answers:

1

I'd like to create a menu item in Joomla that points to one article when the user is logged out, and a different article when the user is logged in. I tried creating two menu items, and make them conditional by setting the access level. However, with that strategy, I can only make the logged-in item appear after login; I found no way to make the other menu item go away after login.

Any suggestions?

+2  A: 

Modify your template with this code:

<?php $user =& JFactory::getUser();  if ($user->guest) : ?>
   <jdoc:include type="modules" name="menu-guest" style="xhtml" />
<?php else : ?>
   <jdoc:include type="modules" name="menu-registered" style="xhtml" />
<?php endif; ?>

Now set two different menus and 2 different menu modules and point them to the correct position: menu-registered and menu-guest.

Flavio Copes
How can I apply this approach to menu items?
Martin v. Löwis
Flavio means create two completely separate menus, one with the 'logged in' option and one with the 'logged out' option. In the second menu you can use the "Alias" menu type to point to the same links as the first menu.
DisgruntledGoat
Thanks for extending and completing my answer, DisgruntledGoat.
Flavio Copes