Top Left Text cha

Web & App Development

I've looked and looked... there's nothing in the JED that works for this.  There is one plugin that supposedly does this (Nomad), but all it really does is through up a bunch of JS errors in the console when you try to add more than 1 rule.  Even tried manipulating the database data for the plugin and couldn't get it working.  Seems simpler to just write a PHP script and stick it in a custom HTML module (I use Custom HTML Advanced) - and assign that to the home page only.  Here's the script...

<?php
$user = JFactory::getUser();
$groups = $user->get('groups');
foreach($groups as $group) {
if ($group==10) {
$goto =& JFactory::getApplication();
$goto->redirect('/jobseeker-control-panel');}
if ($group==11) {
$goto =& JFactory::getApplication();
$goto->redirect('/employer-control-panel');}
}
?>

So there's no need to install a plugin for something this simple. That is, if there were such a plugin.

Of course you'll have to change the group numbers and redirection URL. Just look in the user group manager to decide what number to replace '10' and '11' with. And I'm sure you can figure out where you need them redirected to.

Add comment


Security code
Refresh

  • Guest - Timothy Johns

    @Marshall That will loop through all the groups that user is part of. If you want it to redirect to one group first, then the next lower in the hierarchy, just order the conditionals in the order of highest first.

  • Guest - Marshall S

    I know this is an old thread but I have one question with this code. First, thank you, I have implemented it and works like a charm for those who are part of one group! Now the question - What would be the best way to handle those users who are part of two groups listed in the code. I thought I could work the order to create a hierarchy but it servers up the same group redirect no matter the order. Any help would be appreciated. Thank you

  • I agree. Thanks for the positive vibes!:)

  • Guest - RodeoKid

    Thank you very much for this nice little script...so easy but yet so powerful ! Possibility to have different homepages for each group should be something included in Joomla core !
    Have a nice day !!

Leave your comments

Post comment as a guest

0
Your comments are subjected to administrator's moderation.
X