I've asked this question once before with no results. However, this time I am using the Contact Us form in a CMS page. The URL redirects are all working properly. Everything is submitting properly as well. However, the success message is moving the page title down and displays on top of the success message, itself. At first, there were two success messages being displayed. I fixed that by removing <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> from the contacts/form.phtml file. Now the success message only displays once, but my problem still persists.

I've tried to add this code to contacts/form.phtml:

<div id="messages_product_view">
<?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?>
<?php echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml(); ?>

but this code just removes the success messages from showing completely.

I cannot find anywhere where the success message is being called for. I deleted it from the contacts/form.phtml file so I don't quite understand why it displays. I definitely want it to display, just not twice. Either way, I cannot find anywhere where to tell the success message to NOT move my page title down and over top of the success message.

This is VERY annoying and I have searched everywhere and cannot find a solution for this. Any help would be appreciated. enter image description here

  • is it cms page?
    – Amit Bera
    Commented Oct 16, 2014 at 4:55
  • Yes, it is a CMS page.
    – Lucas
    Commented Oct 16, 2014 at 12:07
  • Here's another clue, I hope. I completely removed the '<div class="page-title"><h2>Contact Us</h2></div>' from the contacts/form.phtml file so that I could use the same code in content of the CMS page. If I didn't do this, the "Contact Us" title bar would still appear where it is in the photo even before submitting the form. It almost seems like something is overriding the CMS '<div class="page-title">' after the form is submitted and the success message is displayed. But where is it doing this?
    – Lucas
    Commented Oct 16, 2014 at 15:50
  • Nobody has any idea??
    – Lucas
    Commented Nov 2, 2014 at 23:00

3 Answers 3


Try to give your div-container a css-class:

<div id="messages_product_view" class="test1"><?php Mage::app()->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('customer/session')->getMessages(true)); ?> <?php echo Mage::app()->getLayout()->getMessagesBlock()->getGroupedHtml(); ?> </div>

And then you define this class in your css-file:

.test1 {z-index: 99999;}

I'm not shure if it works, but on our website it is solved so.

  • Could you be more specific as far as where to put the class? I'm not that experienced so I'm not sure where to put this. I do know where to define the class in css. I just don't know where to put the class.
    – Lucas
    Commented Nov 17, 2014 at 14:19

As Magento is call message block global_messages on above content you have put contacts us on cms page and you need remove message from only your cms page

using below code

<remove name="global_messages" />


<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>

is working

  • I tried using your code on both the CMS page and the contacts/form.phtml. It does not work. When I use it in the form.phtml, it just creates a second success message again. When I use it in the CMS page, it doesn't do anything.
    – Lucas
    Commented Oct 16, 2014 at 12:13
  • Hi Can you send contact us url?
    – Vishal
    Commented Mar 30, 2016 at 11:00

Add below css into this path skin/frontend/rwd/default/css/styles.css

.messages {z-index: 99999;}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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