<?php 
  $pageClassSuffix = JSite::getMenu()->getActive()? JSite::getMenu()->getActive()->params->get('pageclass_sfx', '-default') : '-default';
?>
<body class="page<?php echo $pageClassSuffix ?>">
...
</body>

 Для php 5.3 и выше

<?php 
  $pageClassSuffix = JFactory::getApplication()->getMenu()->getActive()? JFactory::getApplication()->getMenu()->getActive()->params->get('pageclass_sfx', '-default') : '-default';
?>
<body class="page<?php echo $pageClassSuffix ?>">
...
</body>

 Или так

<?php 
$app = JFactory::getApplication();
$menu = $app->getMenu();
$pageClassSuffix = $menu->getActive()? $menu->getActive()->params->get('pageclass_sfx', 'default') : 'default';
if ($menu->getActive()->id != $menu->getDefault()->id) {
echo '<body class="'.$pageClassSuffix.'">';
}
else {
echo '<body class="onmain">';
};
?>