How to check if your on the Home Page that does not use the Front Page layout in Joomla! 1.5 using PHP

Written by Ian Carnaghan · 10 sec read >

Use the code below on any page in your Joomla! application, the code may be changed or modified according to your needs.

	$menu = &JSite::getMenu();
	if (JRequest::getInt('Itemid') == $menu->getDefault()):
	    echo "I'm on the Home Page";
	    echo "I'm not on the Home Page";

Last Updated On March 30, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of