Posted in: Magento

How to add a default contact form to a Magento CMS page

It’s actually quite simple to do, and I’m surprised that Magento doesn’t come with a default “Contact” page already setup.  First, login to your Magento admin and navigated to CMS > Pages.

Click “Add New Page” button.

Just fill in your Title, URL Key and select your Store View. Make sure the status is “Enabled”, and click the “Content” tab on the left.

Enter whatever text you’d like to display on the page and when finished just paste the following where you would like the form to display.

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

Click “Save Page” and that’s it!

Note: If you need to add/remove/change your form fields then just open app/design/frontend/default/YOURTHEMENAME/template/contacts/form.phtml and make your edits there.

 

1 comment

  1. Nilsson - May 24, 2015 11:42 am

    I’ve found this solution for adding a contact form to CMS pages in many Magento tutorials. It’s very straightforward and works fine if you’re not bothered by the limited options of Magento’s default contact form.

    I prefer using this contact forms solution by Plugin Company. It allows you to easily create unlimited custom contact forms and insert them in any CMS page or block as a widget.

    Reply

Have your say