A Real Magento Contact Page
By default Magento has a very boring contact page that contains no company info. To remedy this for my clients I have been creating a static block where they can enter their contact information such as mailing address and phone numbers as well as adding images and any messages they would like.
This is my solution.
Here’s a working example to check out: Contact PIR Tactical
To make this work we will be modifying the contacts.xml layout file to get the static block and then creating the static block under cms – static blocks in the admin.
Edit Magento Layout XML File
First, open the contacts.xml file located in app/design/frontend/default/YourTheme/layout/contacts.xml I have been adding a cms static block named “contact-info” to the contact page layout so it appears above the contact form.
<reference name="content"> <block type="cms/block" name="contact-info"> <action method="setBlockId"><block_id>contact-info</block_id></action> </block> </reference>
Save the new contacts.xml file and upload to your server.
Add CMS Static Block
Now log into your Magento Admin and go to CMS – Static Blocks. Choose “Add New Block” Name the block “Contact Info” and set the identifier to “contact-info” and then enable the block. You can now enter any html you wish to your contact page above the contact form. No reason you can’t add more information below the form using the same technique.






August 12th, 2009 at 7:21 am
I’ve tried creating the static block reference in the contacts.xml file and then creating the static block. When I reference the static blog in a CMS page it just gives me the html that preceeds the contact form and no contact form. It’s seems simple enough, but I’m not sure why the form is being included.
August 23rd, 2009 at 11:55 am
Hunter- This code is to place a static block of custom text and/or images on your contact page. It is not meant to place the contact form on a cms page.
To add a contact form on a cms page try inserting this code:
{{block type=”core/template” name=”contactForm” template=”contacts/form.phtml”}}
October 20th, 2009 at 4:35 pm
This was a great example and it worked as advertised. Thank you. This actually clarified a process that the Magento site did a poor job of explaining.