I like to add a body class to all of my template installations because it makes styling individual pages very easy. Adding a page class to a menu item doesn't always do the trick, because it only affects the component area of the page. Here is how I do it for Joomla 4/5:
Add this to the head area:
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu()->getActive();
$pageclass = '';
if (is_object($menu))
$pageclass = $menu->getParams()->get('pageclass_sfx');
?>
And this code to the body area:
<body class="<?php echo $pageclass ? htmlspecialchars($pageclass) : 'default'; ?>">
Anything without a page class will use a class of "default", anything with the page class defined will appear as the class entered into “Page Class” in the Menu Manager.
The problem I am having is that the Samba Spa template overrides the body class in mobile view, rendering it like this:
<body id="s5_body" class="s5_responsive_mobile_present">
I made a post in the Joomla forums about this issue here.
In that thread, Pavel-ww mentions that the problem with Body classes comes from this file "s5_responsive_mobile_bar-min.js" The logic of the script should be rewritten so that it does not replace the classes, but adds to the existing ones.
So how can I do this? My knowledge of javascript is pretty slim. Here is the website by the way:
https://feminapt.com/