When you need a different condition for your Joomla 1.7 homepage
If you need to place a condition for youe home page in your joomla 1.7 template - we prefer using this code:
<?php if ($menu->getActive() == $menu->getDefault()) { ?>PUT ACTION HERE <?php } ?>
It doesn't depend on function, but purely works on the fact that if you are on the home page.
When do we use this conditional statement?
We don't use it for module assignment or any of the things you can do in the backend (yoursite.com./administrator).
We like it for adding a class or id to an element unique to the home page.
Audra's enthusiasm really kept the training interesting! I particularly liked the hands-on training and real world application. I feel Audra really made an effort to customise the training to our needs. ![]()
Emma Richards
Business Type: NGO Service
What We Do
-
Web Maintenance


























