0
Welcome Guest! Login
0 items Join Now

How To: Hide modules for logged in users?

  • How To: Hide modules for logged in users?

    Posted 15 years 10 months ago
    • I've always thought this should be a feature, and maybe it is, but I can't find it, so I'll ask you gurus here.

      My right side modules scroll down the page, containing a brief mission statement, login form, and other ads, etc.

      When a user logs in I'd like to be able to remove all that and just replace it with user account maintenance options, latest forum posts, etc. Setting a module to "registered" users means only logged in users can see it, but is there a way to hide certain modules if you're already logged in so I can recover that screen real-estate for other uses?
    • Best Regards,

      Tommy Jordan
      Twisted Networx
      twistednetworx.com
    • JEM's Avatar
    • JEM
    • Preeminent Rocketeer
    • Posts: 17917
    • Thanks: 4

    Re: How To: Hide modules for logged in users?

    Posted 15 years 10 months ago
  • Re: How To: Hide modules for logged in users?

    Posted 15 years 10 months ago
    • Thanks for the link. Looks like a good start for this site and for some others too. The JUGA component seems pretty versatile. I'll do some other looking around too. Thanks again!
    • Best Regards,

      Tommy Jordan
      Twisted Networx
      twistednetworx.com
    • Vadique's Avatar
    • Vadique
    • Sr. Rocketeer
    • Posts: 109
    • Thanks: 0

    Re: How To: Hide modules for logged in users?

    Posted 14 years 8 months ago
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: How To: Hide modules for logged in users?

    Posted 14 years 8 months ago
    • if your good at hacking your template try
      <?php
      define( '_JEXEC', 1 );
      define('JPATH_BASE', dirname(__FILE__) );
      define( 'DS', DIRECTORY_SEPARATOR );
      require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
      require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
      $mainframe =& JFactory::getApplication('site');
      $mainframe->initialise();
      $mainframe->route();
      $user =& JFactory::getUser();
      $usertype = $user->usertype;
      $username = $user->username;
      $admin = "Super Administrator";
      if ($usertype == $admin) {
      Then have your module here
      }
      ?>


      This works but probably isnt the best mothod, but its so custom that you could set it to show something for a specific user (username), user type(admins, registered) etc...
      If you want to hide it from the admin use something like
      if ($usertype == !$admin) {

      or put an else statement in their to show 1 thing to the admin but another to averyone else.
    • Kiss my RSS
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29362
    • Thanks: 954
    • Volunteer

    Re: How To: Hide modules for logged in users?

    Posted 14 years 8 months ago
  • Re: How To: Hide modules for logged in users?

    Posted 11 years 1 month ago
    • I solved this with the showcase at the top of the page as I only wanted it to display to public users.

      In the Module mod_roksprocket just go to the "Assignments" tab and scroll down to "Users".

      I edited the settings there to include only public and Bingo !
    • Turning Ideas Into Reality Since 1995

Time to create page: 0.095 seconds