Joomla 2.5 Is there a way to add a specific css class to the body which is specific to a logged in user's group.
For example I have four user groups, Individual Premium, Individual Standard, Corporate Premium and Corporate Standard. I want to have something like:
<body class="individual-standard">
or
<body class="corporate-standard">
This is the current body tag:
<body id="ff-<?php echo $fontfamily; ?>" class="<?php echo $fontstyle; ?> <?php echo $pstyle; ?> <?php echo $bgstyle; ?> <?php echo $pageclass; ?> iehandle">
I have tried putting this in the head:
$user =& JFactory::getUser();
$pageclass ="";
if(array_key_exists('individual premium',$user->groups)){
$pageclass .="individual-premium";
}
if(array_key_exists('corporate premium',$user->groups)){
$pageclass .="corporate-premium";
}
if(array_key_exists('corporate standard',$user->groups)){
$pageclass .="corporate-standard";
}
if(array_key_exists('individual standard',$user->groups)){
$pageclass .="individual-standard";
}
And this is the body tag:
<body id="ff-<?php echo $fontfamily; ?>" class="<?php echo $fontstyle; ?> <?php echo $pstyle; ?> <?php echo $bgstyle; ?> <?php echo $pageclass; ?> iehandle">