Magento Global Messages on CMS pages

Magento Global Messages on CMS pages

October 12, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Global Messages on CMS pages

Moving Magento Global Messages on CMS Pages: A Comprehensive Guide

Managing Magento global messages on CMS pages can be a challenging task for developers, especially when it comes to ensuring design consistency across your website. If you’re facing issues where global messages push down content and disrupt layout elements like page titles, you’ve come to the right place.

The Problem: Layout Disruption with Global Messages

When a user submits a form on a Magento CMS page (like a newsletter signup), Magento displays success or error messages using the global messages system. By default, these messages appear above your content block, which can lead to layout issues when they are displayed.

In your case, you’ve noticed that:

  • The global message pushes down other elements
  • White text of the page title is moved off the green background image
  • The text becomes difficult to read over a light grey background

You’re right in suggesting that moving these messages within the XML could potentially solve this issue. Let’s explore how we can achieve this.

The Solution: Customizing the Magento Layout

Magento uses an XML layout system to define where blocks are placed on pages. To move the global messages below your page title, you need to modify the cms_page_view.xml layout file.

Here’s a step-by-step guide:

  1. Navigate to your theme directory (or base theme if using a child theme).

  2. Find or create the page_xml_layout folder.

  3. Open or create the cms_page_view.xml file and add the following XML code:

<?xml version="1.0" encoding="UTF-8"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layouts.xsd">
    <layout id="cms_page_view">
        <referenceBlock name="page.messages">
            <arguments>
                <argument name="display_in_quick_pane" xsi:type="boolean">false</argument>
            </arguments>
        </referenceBlock>

        <move element="page.messages" destination="content.main" after="page.title" />
    </layout>
</layout>

This XML code does two things:

  • It removes the global messages from the quick pane (optional).
  • It moves the page.messages block to the content.main container and places it after the page.title.
  1. Save the file and refresh your Magento cache.

How This Solves Your Issue

By moving the page.messages block with the <move> tag, we ensure that the global messages appear within the main content area. They are now placed below the page title, preventing them from pushing down other elements on the page.

This approach ensures a cleaner layout and maintains the visual consistency of your CMS pages, even when messages are displayed.

Conclusion

Moving Magento global messages on CMS pages requires careful manipulation of the XML layout system. By following this guide, you can successfully position these messages below your page title, preventing them from disrupting other layout elements.

Remember, customizing layouts is a powerful tool in Magento development. It allows for fine-grained control over how blocks are displayed across different page types.

Don’t forget to check out the official Magento documentation and our comprehensive blog posts at https://laravelcompany.com for more advanced layout customization techniques.

Happy coding!

Themes Errors

Our network