Show Joomla modules for certain Joomla Groups only
Thursday, 13 September 2007

This might me one of the features that you where looking for in Joomla for long time. Here is short and effective how to.

 For demo we are using our user12 position which is google ads  on the bottom of this page. This module is visible for guests and regular registered user only. If you are our Joomla Templates Club member you will not see this module .

  Locate the module position in your template index.php file that you want to show to special users only.

 

Here is our code

 

<?php
  if (( $my->gid == 0 ) || ( $my->gid < 30 )) {
    mosLoadModules( 'user12', -2 );
  }
?>


Which states only if you are a guest or your joomla group id is lower than 30 you will see the google ads .Since we have additional user groups in our joomla installation we used lower than 30. You can use lower than 25 which is joomla super administrator .Now replace the module position name to the one you need and you are done.

Here is also image of standard user groups in joomla:

 

Go ahead now play with it and restrict acsses to certain joomla user groups.

 

Please contact us if you would like to place this article on your site.