Joomla: How to check if the current page is Home Page or not in Joomla

June 2, 2011 | In: Joomla, php, web development

Joomla is a best custom management open source tool. It provides many type of functionality regarding theme, module and components. During development time we need to create some special function to use on home page only. or we can say that sometimes we want to show something (content) on the home page only. Joomla says Front page to the Home page in development environment. you can see the code in below:

    <?php if (JRequest :: getVar('view') == 'frontpage') : ?>
        <!– Code for home page –>
    <?php else : ?>
         <!– Code for other pages. –>
    <?php endif; ?>