I need show success or error messages
block at the top of the page before the header
block. As of now it appears between the breadcrumbs
and main
block.
Magento 2 – How to Show Success or Error Message Block at Top of Page
magento2messages
magento2messages
I need show success or error messages
block at the top of the page before the header
block. As of now it appears between the breadcrumbs
and main
block.
This is not due to magento's code. Please make changes in css.
Add class
.contacts-index-index .page-title { margin:0; }
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.
Best Answer
There are a couple of ways to do this. Here is one which requires a little layout xml and a new template at a minimum…
Layout:
Template:
app/design/frontend/your_package/your_theme/template/core/messages/top.phtml
Alternate way
add belwo line at
app/design/frontend/your_package/your_theme/Magento_Theme/laout/default.xml