Joomla! Environment Variables in CSS and Javascript

Here's something I use in templates so that it's easy to apply special styles or effects to certain pages based on the Joomla! environment variables...

$Itemid = JRequest::getInt( 'Itemid', 0 );
$option = JRequest::getCmd( 'option', 'none' );
$view = JRequest::getCmd( 'view', 'none' );
$id = JRequest::getInt( 'id', 0 );
echo "<body id='Itemid_{$Itemid}' class='option_{$option} view_{$view} id_{$id}'>";

0 Comments

Add Comment


  • >:o
  • :-[
  • :'(
  • :-(
  • :-D
  • :-*
  • :-)
  • :P
  • :\
  • 8-)
  • ;-)