How to change Magento contacts page into a 1 column layout

How to change Magento contacts page into a 1 column layout

To change the Magento contacts page into a 1-column layout, you need to modify the page’s layout XML file. First, navigate to your theme’s directory, typically located in app/design/frontend/{Vendor}/{Theme}/layout/. Find or create the contacts.xml file if it doesn’t already exist. Within the XML file, you’ll want to update the layout by changing the <referenceContainer name="content"> to use a 1-column structure. You can do this by adding the following code:

<referenceContainer name="content">
<container name="main" as="main" label="Main" htmlTag="div" htmlClass="main">
<block class="Magento\Cms\Block\Page" name="page.main.title" template="Magento_Cms::page/title.phtml"/>
<block class="Magento\Contact\Block\ContactForm" name="contact.form" template="Magento_Contact::form.phtml"/>
</container>
</referenceContainer>
This code will force the content area to display in a single column. After making these changes, clear Magento’s cache from the admin panel under System > Cache Management, and your contacts page will now be displayed with a 1-column layout.
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *