where can I change the column-layout (2-column left, 2-column right etc) of the default contact page in Magento?
thanks
Customize the Contact Us Page in Magento 2Navigate to Content > Blocks and find the Contact Us Info block. 2. Add the changes you need to the content of the page and Save the block. After you apply the changes, the Contact Us page will be different based on your configurations.
A CMS block is injected into the layout by using the Magento/Cms/Block/Block class with the block_id argument. Any block or container can be used as a reference. As a result, the CMS block added to the bottom of the page.
First, determine the "layout handle" for the contact page. If this is the page you're talking about, then your layout handle is
contacts_index_index
Next, find the layout handle in your layout.xml file
<contacts_index_index translate="label">
<label>Contact Us Form</label>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
<reference name="content">
<block type="core/template" name="contactForm" template="contacts/form.phtml"/>
</reference>
</contacts_index_index>
Change the setTemplate call to reference your template
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
Alternately, add the handle reference to your local.xml
file. The local.xml
file is applied last, so whatever goes in there "wins"
<layout>
<contacts_index_index>
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
</contacts_index_index>
</layout>
The layout of the contact page is set in contacts.xml. So, an alternative method is:
1. Find contacts.xml in the base layout folder
2. Copy the content in that file
3. Create a new contacts.xml file in the layout folder of your template
4. Paste the content of that file and find the line that sets the default layout
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
5. Change that line to whatever you want your default layout to be
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
<action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
</reference>
6. Save, and it overrides the default layout
Firstly, Find contacts.xml in the base layout folder, then in 41 line,
change this code from
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
to
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With