Joomla php how to check if the user is viewing the specific page

advertisements

I want to add a facebook plugin to a specific joomla page. To check if the user is viewing the homepage i use the following:

<?php
$menu = JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
    echo 'This is the front page';
}
?>

I don't know how this code works, but i think the 'getDefault() method return me the homepage url. Now i want to do the same, not for the frontPage but for a specific page, lets say:

www.myDomain.com/contactos

How can i accomplish that?


You an get current menu_id & menu_name respectively like this:

$currentMenuId = JSite::getMenu()->getActive()->id ;

$currentMenuName = JSite::getMenu()->getActive()->name ;