If you are using Joomla older version like 1.0 then you’ll only need to verify the current component with the following command:
if ($option == 'com_frontpage' || $option == '') {
echo 'This is the front page';
}
Bellow porsion for Joomla! 1.5 could be easily confirmed by the following command:
if ( JRequest::getVar('view') === 'frontpage' ) {
echo 'This is the front page';
}
Just in case the above command doesn’t work then the issue could be a little more complicated and need to check if the current active menu item is the default one. I saw this issue in some 1.5 early versions.
$menu =& JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
Dimitar Dimitrov
thanks a lot for this tip, and thanks at all for sharing all your knowledge with everyone! God luck!
Dimitar Dimitrov
For multi-lingual sites the front page is dependent on the currently selected language, so you will need to use code like this:
getActive() == $menu->getDefault( 'en-GB' )) {
echo 'This is the front page';
}
elseif ($menu->getActive() == $menu->getDefault( 'fr-FR' )) {
echo 'Accueil';
}
?>