Created
January 21, 2012 01:54
-
-
Save betweenbrain/1650738 to your computer and use it in GitHub Desktop.
Add Joomla Menu Item ID as Body Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In your template: | |
------------------- | |
<?php defined('_JEXEC') or die; | |
// Menu Item ID | |
$itemId = JRequest::getInt('Itemid', 0); ?> | |
<body class="<?php echo 'item-' . $itemId;?>"> | |
... | |
</body> | |
In your style sheet | |
------------------- | |
.item-6{ | |
background: #ff0000; | |
} | |
.item-7{ | |
background: #BADA55; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great! Thanks!