Search code examples
joomlajoomla1.5joomla-template

how to don't display some positions in the internal pages in Joomla


I am developing a Joomla! 1.5 template. I have user1,user2 and user3 positions. I want to display these positions on the front page only not the internal pages. but I don't know how to implement it.

would you help me ?


Solution

  • In top of /templates/TEMPLATENAME/index.php add these lines:

    <?php $isHomePage = (JSite::getMenu()->getActive()->id == JSite::getMenu()->getDefault()->id); ?>
    

    And then find rows, where module positions are included and modify them. From:

    <jdoc:include type="modules" name="user1" />
    

    , to:

    <?php if ($isHomePage) { ?>
        <jdoc:include type="modules" name="user1" />
    <?php } ?>