Add the Magento contact form to a CMS page as a static block

Magento has a built-in contact form that does the job, but isn't the easiest to edit. You may for example want to add your company address, contact details or even a Google Map.

This can be quite easily achieved by creating your own CMS page and including / embedding the contact form portion of the standard Magento contact form as a static block.

To achieve this, do the following:

1. Create your CMS page in Magento Admin (CMS > Pages)
2. Paste the following code in your HTML where you would like the contact form to be positioned in your CMS page:

<!-- contact form start –->
{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
<!-- contact form end -->

 

If you need to edit the actual contact form HTML (more advanced), edit the file at:
app/design/frontend/default/[yourtheme]/template/contacts/form.phtml. Your theme location may differ.

  • 112 Users Found This Useful
Was this answer helpful?

Related Articles

Magento User Guide (Official and Free)

Magento offer a paid ebook User Guide (which costs around USD$20). What a lot of people don't...

Importing customers to Magento using Import/Export Profiles (Magento 1.3*)

This knowledgebase explains how to setup a simple .csv file in order to import your existing...

Error - Skip import row, required field sku not defined, Skip import row, required field store not defined

This knowledgebase explains how to solve the "Skip import row, required field "sku" not defined"...

Error - There was a problem with reindexing process (Catalog URL Rewrites)

Magento has a tendancy to append a number to URL's (such as -1) in order to keep them unique....

Error - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example_magento.core_directory_storage' doesn't exist.

After upgrading to Magento 1.5, you may get the following error when trying to upload an image...