April 20th, 2007
How to detect the home page on a Joomla site
Create beautiful Joomla websites with a flexible layout from iJoomla.com
Recently I had to add some PHP code to the template of a Joomla site I run, but I wanted that code to run on the homepage only. Considering the fact that I'm using an SEF component on the site, it was tricky, but here's the line of PHP code I was able to do it with:
$pge = $_SERVER['QUERY_STRING']; if ($pge == "/index.php"||$pge == "") {
//do stuff
}
//do stuff
}
Create beautiful Joomla websites with a flexible layout from iJoomla.com

on April 26th, 2007 at 5:41 am
Top man, that's a simple enough line… all I gotta do now is think of stuff to do now that I know it's do-able.
on May 21st, 2007 at 7:04 am
Had to Modify your code to work for me as below
Your Page Title ";
}
?>
on May 21st, 2007 at 7:06 am
Your Page Title ";
} ?>
on May 21st, 2007 at 7:07 am
}
?>
on May 21st, 2007 at 7:25 am
$pge = $_SERVER['QUERY_STRING']; if ($pge == "/index.php"||$pge == ""||$pge == "option=com_frontpage&Itemid=1") {
//do stuff
echo " Your Page Title ";
}
on May 29th, 2007 at 4:25 am
thank you very very much! that literally solved my provlem with adding a special flash script just to the startpage.
you are genius! thanks again!