Magento – In magento, how to hide header and footer in every page for specific category ID

categorylayout

I would like to know how to hide header and footer for specific category ID.
For example, I have 5 categories: categories are cat1, cat2, cat3, cat4, cat5. I want to hide header and footer in every pages if the category id is equal to cat1. Is it possible to do so?

Best Answer

Simon has a good answer but you can also do this through the admin control panel in Magento using a custom layout update setting on the category editor:

  • Log in to your admin console and visit Catalog > Manage Categories.
  • Select the category you want to change in the left column.
  • Click the "Custom Design" tab in the middle column.
  • Set "Use Parent Category Settings" to "No"
  • inside the "Custom Layout Update" box add the following:

<remove name="header" />

<remove name="footer" />

  • Save the category's changes and go check your website.

This will affect the selected category and all it's child categories by default. If you later want to change another category, you can repeat these steps on that category. You can also re-edit this category and reverse these steps to change the design of that category back again.

disclaimer

I tested this on 1.7 and I have just assumed that the same functionality exists in whichever version you are using.