I am doing something to my client’s Joomla page. The code is like this:
$menu = JSite::getMenu();
$arr = (array)$menu->getActive();
$alias = $arr['alias'];
echo $alias;
if ($alias = "volunteering-2") {
echo('<div class="item-page"> <h2>Volunteering</h2></div>');
}
else if ($alias = "contact-us2") {
echo('<div class="item-page"> <h2>Contact Us</h2></div>');
}
The problem is, the Contact Us H2 header is never appear, even the if statement is correct.
You can see the page here: http://dzulhel.me/yyDk9m
Try to see the page in Volunteering and Contact Us
I try tackle using ID instead of alias but it still the same.
try this. think you’re missing “equal-to” sign.