0
Welcome Guest! Login
0 items Join Now

how to drop menu item for registered users

    • Randy Carey's Avatar
    • Randy Carey
    • Rocketeer
    • Posts: 77
    • Thanks: 0
    • web architect, book/magazine author

    how to drop menu item for registered users

    Posted 13 years 8 months ago
    • When someone logs in to the front end, I want a particular menu item not to display in the main menu. Is there a known way to do this with Gantry and the Fusion-Menu?

      What I'm trying to do is have some items show for anonymous visitors, and once they log in one or more menu items are dropped and replaced with a different menu item. I can use access levels on the menu items to add more items once someone is logged in, but I don't know how to remove a menu item. This may be a general Joomla issue, but with Gantry taking over some control of the main menu, I'm asking here to see if anyone knows a solution when working with Gantry. (I just updated to Gantry 3.0.9)
    • Randy Carey's Avatar
    • Randy Carey
    • Rocketeer
    • Posts: 77
    • Thanks: 0
    • web architect, book/magazine author

    Re: how to drop menu item for registered users

    Posted 13 years 8 months ago
    • I found a solution, though not as elegant as for what I was searching.

      In the template I added some php conditional code. If the template senses a user id, it surrounds the top level menu with a div and id. Then I set up a CSS rule "display:none" applied to that menu item when it is found within that id.

      This is not ideal, but it is a workable solution.

      in index.php...
      <?php $my =& JFactory::getUser();
            if ( !$my->id ) {echo '<div id="registeredVisitor">';} ?>
       ...menu code...
      <?php if ( !$my->id ) {echo '</div>';} ?>

      in template.css...
      div#registeredVisitor li.item39 {display:none;}
    • LiEs's Avatar
    • LiEs
    • Sr. Rocketeer
    • Posts: 238
    • Thanks: 0

    Re: how to drop menu item for registered users

    Posted 13 years 8 months ago
    • That seems the way to do it, but couldn't you use Joomla groups
      <?php $user =& JFactory::getUser();
      if ($user->guest) { ?>
      menucode
      <?php
      } else {
      ?>
      othermenustuff
      <?php
      }
      docs.joomla.org/Accessing_the_current_user_object

      I personally have used Community ACL (pricey), and works with rocket themes menu.

Time to create page: 0.038 seconds