cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 CMS page without header and footer

SOLVED

Magento 2 CMS page without header and footer

Hi all,

 

A merchant wants to create a cms page without header and footer in Magento 2.

How to achieve?

 

Appreciate all your responses.

 

Thanks,

Rama.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 CMS page without header and footer

Hello Rama @rnyshadhin296a 

 

To create a CMS page in Magento 2 without the header and footer, you can follow the below steps:

1: Log in to your Magento 2 Admin Panel.

2: Navigate to Content > Elements > Pages.

3: Click on the "Add New Page" button.

4: Fill in the required fields like Page Title, URL Key, etc.

5: In the "Content" section, switch the editor mode to "HTML" by clicking on the "Show/Hide Editor" button.

6: Remove the default content and add your custom content for the page.

7: To remove the header and footer, you can use layout update XML. In the "Design" section, click on the "Layout Update XML" tab.

8: In the XML field, you can add the following code to remove the header and footer:

<referenceContainer name="header" remove="true" />
<referenceContainer name="footer" remove="true" />

9: Save the page.

10: Clear the cache by going to System > Cache Management and refreshing all cache types.

 

Now, when you access the CMS page you created, it should not display the header and footer.

 

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9

View solution in original post

3 REPLIES 3

Re: Magento 2 CMS page without header and footer

95 Views, but no replies!

Very strange!

 

I am new to Magento and started to learn it.

If I do not find answers to my queries in this forum, what is the forum for me.?

 

All my three posts are of the same state.

 

Thanks,

Rama.

Re: Magento 2 CMS page without header and footer

If you simply use CSS to hide it, then this part must be rendered and resources must be used. In order to do this, I think you would override one of the xml layout files.
Try something similar to this:

<page xmlns:xsi="http://www.xyz.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <body> 
      <referenceBlock name="header.container" remove="true" />  
      <referenceBlock name="footer.container" remove="true" />
  </body> 
</page>

Re: Magento 2 CMS page without header and footer

Hello Rama @rnyshadhin296a 

 

To create a CMS page in Magento 2 without the header and footer, you can follow the below steps:

1: Log in to your Magento 2 Admin Panel.

2: Navigate to Content > Elements > Pages.

3: Click on the "Add New Page" button.

4: Fill in the required fields like Page Title, URL Key, etc.

5: In the "Content" section, switch the editor mode to "HTML" by clicking on the "Show/Hide Editor" button.

6: Remove the default content and add your custom content for the page.

7: To remove the header and footer, you can use layout update XML. In the "Design" section, click on the "Layout Update XML" tab.

8: In the XML field, you can add the following code to remove the header and footer:

<referenceContainer name="header" remove="true" />
<referenceContainer name="footer" remove="true" />

9: Save the page.

10: Clear the cache by going to System > Cache Management and refreshing all cache types.

 

Now, when you access the CMS page you created, it should not display the header and footer.

 

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9