6

is it possible to remove both the header and footer and only display the contents of a CMS page? If so, how?

Currently the html looks something like this by default:

<body class=" cms-page-view cms-info-shipping cms-info-shipping">
    <div id="header">...</div>
    <div id="content">...</div>
    <div id="footer">...</div>
</body>

Thanks in advance for any elucidation.

3 Answers 3

15

when editing the cms page, there's a field called layout update. use this code in it:

<reference name="root">
    <remove name="header"/>
    <remove name="footer"/>
</reference>
5
  • This will work but only if the layout you are using have this names for the header/footer block
    – mbalparda
    Commented Dec 10, 2014 at 19:18
  • and if you're not using certain plugins, and heavy caching... it was a raw magento question, no other specs. by default, those blocks are called that way in magento. there's no need for an extra file (plus a package and a theme) just to remove the header and footer. it's a good approach to other things, but i wouldn't use it in this case
    – Cristi
    Commented Dec 10, 2014 at 19:22
  • @Cristi Is possible to change header and footer for multi-store with the same theme.
    – zus
    Commented Dec 25, 2017 at 12:23
  • How to add two header for multi store
    – zus
    Commented Dec 26, 2017 at 6:22
  • @zus yes it is, but it depends on your setup
    – Cristi
    Commented Dec 26, 2017 at 13:38
4

CMS pages have a layout associated to it.

You can create a custom layout and remove everything you dont want to have in the page and then assign it to the CMS page in the Design tab.

4

In admin section there are options to set the layout of CMS page. Please choose empty.

It will remove the header and footer and only shows the content of CMS page.

CMS > Edit CMS Page > Design > Layout > empty.
1
  • 1
    @mishra : If you using multi-store, this trick not working.
    – zus
    Commented Dec 26, 2017 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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