Put this in the <head> section of your /template/index.php file:
<?php $app = JFactory::getApplication(); $menu = $app->getMenu()->getActive(); $pageclass = ''; if (is_object($menu)) $pageclass = $menu->params->get('pageclass_sfx'); if ($pageclass != "homePage") {$otherclass = " interiorPage";} else {$otherclass = "";} ?>
Then replace the <body> tag of index.php with:
<body class="<?php echo $pageclass ? htmlspecialchars($pageclass) : 'default'; ?><?php echo $otherclass; ?>">
How to use:
Navigate to the menu item of the page you would like a unique style on.
Under the 'page display' tab, enter the class you want to use in the field, 'Page Class'. This comes with another advantageous element. If you use the class, 'homePage' on your home page, it will also include the class, 'interiorPage' on all pages other than the home page.
Comments