Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I have included contact us form in cms page using below code

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

But after doing this, message after submitting the form is coming twice.

http://i.stack.imgur.com/PScwj.png

How this can be rectified? Any help will be appreciated.

share|improve this question

1 Answer 1

up vote 4 down vote accepted
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>

This is inside the app/design/frontend/base/default/template/contacts/form.phtml So the messages are just echo'ed twice. Either remove the standard message block from the layout or remove the above from the template. I think editing the template is easier.

share|improve this answer
    
Thanks Fabian, but I also need to know if it is a bug or a process in including contact us block in cms page. I guess it is in process, am I correct? –  Anshu Mishra Mar 4 at 11:06
1  
The contact form is normally added via layout.xml to the page and no extra message block. I don't know, why this is implemented this way, if you ask me, this doesn't make sense, but maybe magento wanted the messages at a special place. So this is no real bug, just a side effect if you use the contact form in a place it isn't standardly implemented (but intended!) for. –  Fabian Blechschmidt Mar 4 at 11:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.