I have a website with a special background-images on the article=home and a different background-image on all other articles. I use the following code in the template index.php:
<?php
$active = Jfactory::getApplication()->getMenu()->getActive();
if ($active->alias == 'home') {
?>
<style type="text/css">
<!--
body {
background-image: url(http://mywebsite.com/templates/img/page_home.jpeg);}
-->
</style>
<?php } else { ?>
<style type="text/css">
<!--
background-image: url(http://mywebsite.com/templates/img/page_others.jpeg);}
-->
</style>
It's working fine on Desktops. As soon the as the monitor width is smaller than specified in ".css @media" and the responsive Menu-Button is activ then the ...->getMenu()->getActive(); is not anymore saying the "$active->alias". How can i ask the responseive Menu alias?