I have a template called test.phtml in \magento\app\design\frontend\rwd\newtheme\template\test\test.phtml

In page.xml layout file I am not getting how to add my template to appear in all pages except product page.

  • in which block you want to display the template? – Piyush Oct 13 '17 at 10:08
  • in content block – Abhilash Narayan Oct 13 '17 at 10:19

You have to add two layout update in your layout.xml file

First to add your template in all pages

    <reference name="content"> // Changes you reference accordingly
         <block type="core/template" name="customtestblock" template="test/test.phtml"/>

Second to remove block from category page

    <remove name="customtestblock"/>

    <remove name="customtestblock"/>
  • There is no file called layout.xml in layout folder. Should I create it? – Abhilash Narayan Oct 13 '17 at 10:22
  • it was just an example, you can add it to any existing module's layout file or in local.xml file – Piyush Oct 13 '17 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.