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.


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

<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.

  • 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 '14 at 11:06
  • 2
    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 '14 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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