Last active
October 19, 2018 16:06
-
-
Save tassosm/a0be351aceb9f90e8b8be203a262085d to your computer and use it in GitHub Desktop.
Joomla - Detect if we're browsing the homepage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load Menu class | |
$menu = JFactory::getApplication()->getMenu(); | |
// Determine if the user is viewing the front page | |
$isHomePage = ($menu->getActive() == $menu->getDefault()); | |
if ($isHomePage) | |
{ | |
echo 'This is the front page!'; | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment