There are times when we want to apply different styles to different Joomla pages based on menu. In this very short article I am going to show how to add classes to body tag. This is for Joomla, but it works for gantry framework too, you can see it on image above
It requires two short snipped of code injected into index.php inside your joomla template.
All you need is add :
which takes active menu object (home, typogrphy, whatever…) and later render it into body class
<body class=”<?php echo $active->alias;?>”
Next step is to add styles.
It gives you great flexibility to your joomla design.