I created a new page layout, but I noticed that it does not get loaded last and it gets overridden from other layouts.

Is there a way to change the load order so that my custom page layout gets loaded last?


I have this simple layout where I create a new block which just shows the text foobar123. I move it after the header.container.


<?xml version="1.0"?>
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <block class="Magento\Framework\View\Element\Template"
               template="Hausfux_Base::test.phtml" />

        <move element="test_foobar" destination="page.wrapper" after="header.container"/>



Now I create a new page layout and try to move it after the footer only for this page layout.


<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="hf-grouped-product-big-1col">
        <label translate="true">Hf Grouped Product (Big) -- 1 Col</label>


<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    <update handle="1column"/>

    <move element="test_foobar" destination="page.wrapper" after="footer-container"/>

Now I select my new custom page layout Hf Grouped Product (Big) -- 1 Col on a product and load it, then the text "foobar123" is showing, but still after the header, because my custom page layout is getting loaded before catalog_product_view.xml.

How can I make my custom page layout always get loaded last?


Your Answer

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

Browse other questions tagged or ask your own question.