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.
{code type=xml}
{/code}
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.
March 29th, 2010 at 5:16 am
Thanks for this tip but where do you put that code in the contact.xml file?
March 29th, 2010 at 10:47 am
Look for the contactForm block and put the code before it. You can also place the code after the contactForm block to have your info appear after the form. It should look something like this:
< reference name="content" > < block type="cms/block" name="contact-info" > < action method="setBlockId" >< block_id>contact-info < /block > < /reference > < reference name="content" > < block type="core/template" name="contactForm" template="contacts/form.phtml"/ > < /reference >You will need to remove the spaces from this snippet before and after the <> symbols.
May 11th, 2010 at 9:43 am
Ken,
Thanks for the simple ‘how to’ for this contact us block. Very helpful.
Barracuda
May 20th, 2010 at 12:50 pm
Thanks, this is a great way to do it.
I cannot get that adding a contact form to a page to work in Magento Magento ver. 1.4.0.1, so I resorted to this example.
{{block type=”core/template” name=”contactForm” template=”contacts/form.phtml”}}
May 20th, 2010 at 1:41 pm
I’m just starting a site with Magento ver 1.4.0.1 so I will update things here soon!
March 10th, 2011 at 9:48 am
Thanks for the tip, it worked a treat. I now have all my contact details on one page, much better than before!
April 18th, 2011 at 9:43 pm
Hello, how do we go about doing this if we want the static block to appear to the right side of the contact form comments?
July 17th, 2011 at 9:47 pm
And conversely, the following will put a fully functioning contacts form that sends on submit on any CMS page in 1.4.x.x by making sure the form_action is set.
{{block type=”core/template” name=”contactForm” template=”contacts/form.phtml” form_action=”/contacts/index/post”}}
August 3rd, 2011 at 1:20 pm
I didnt have the contacts.xml in my theme location. I tried to alter the one in blank/default and it still didnt work (I have the static block made as described). I dont see the text I want below the form.
August 3rd, 2011 at 1:42 pm
Sigh! Simply flush of the cache and it’s working. Silly!!! I copied the contacts.xml to my theme folder and I am in business. Thank you!!!!
September 9th, 2011 at 2:12 am
Hi
Question is how can you make a completely separate form other than the contact form.
November 10th, 2011 at 7:08 pm
I use 1.6.0 and I did not have a contacts.xml file located in app/design/frontend/default/YourTheme/layout/contacts.xml; I do have it in: app/design/frontend/base/default/layout, can I copy this one instead of?
November 10th, 2011 at 7:42 pm
Yes you can. Just copy the file into your theme’s layout folder. You can use any of the default Magento files as a template for your customization. Just make sure you copy them into the corresponding directory in your theme. It is perfectly OK to create the directory in your theme if it does not already exist.