Magento – Contact Us Success Message Location Not Displaying Properly

contact-usmagento-1.9messages

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(); ?>
</div>

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

Best Answer

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.