Conditionial statement to show html in Joomla 2.5


/ Published in: PHP
Save to your folder(s)

Show html on homepage and different html on other pages


Copy this code and paste it in your HTML
  1. <?php
  2. $app = JFactory::getApplication();
  3. $menu = $app->getMenu();
  4. ?>
  5. <? if ($menu->getActive() == $menu->getDefault()) { ?>
  6. this is the front page
  7. <?php } else { ?>
  8. do something else
  9. <?php } ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.