magento2-page-builder
magento2-page-builder copied to clipboard
Layout shouldn't be set in a `page_layout` xml file.
Preconditions (*)
- Magento Page Builder version >= 1.3.0
Steps to reproduce (*)
- Create a
Magento_Catalog/layout/catalaog_category_view.xml
in your theme. - Set the attribute
layout
of the xml-nodepage
to1column
Expected result (*)
- Category page has layout one column
Actual result (*)
- Category page has layout two columns left
This issue is caused by the file view/frontend/page_layout/catalog_category_view.xml
. A page_layout
file should never set a layout
becasue they are the last loaded layout xml files. This bug overwrites the value for layout set in the theme.
This is the patch that resolves the issue. I don't have a paid GitHub account, so can't create a PR.
===================================================================
--- a/view/frontend/page_layout/catalog_category_view.xml (date 1592218590076)
+++ b/view/frontend/page_layout/catalog_category_view.xml (date 1592218590076)
@@ -5,7 +5,7 @@
* See COPYING.txt for license details.
*/
-->
-<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
+<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="category.view.container">
<referenceBlock name="category.description" template="Magento_PageBuilder::catalog/category/view/description.phtml"/>
Hi @jasperzeinstra. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.
Please, add a comment to assign the issue: @magento I am working on this
- Join Magento Community Engineering Slack and ask your questions in #github channel.
For what it's worth, layout="2columns-left"
is applied to other instances of catalog_category_view.xml
, too (see attached).

Very strange, after an update from magento 2.4.2-p1 to 2.4.3 suddenly this exact issue surfaced. Now im not able to change the layout on the category page anymore from the theme. When removing the layout attribute in /magento/vendor/magento/module-page-builder/view/frontend/page_layout/catalog_category_view.xml it works again.
I think the issue is that catalog_category_view.xml is in the wrong folder.
Is there any specific reason it is in app/code/Magento/PageBuilder/view/frontend/page_layout ?
If not then it should be moved to app/code/Magento/PageBuilder/view/frontend/layout which fixes the current issue and makes sense given that app/code/Magento/PageBuilder/view/frontend/layouts.xml contains the 3 page layouts and no references to catalog_category_view
<layout id="cms-full-width">
<label translate="true">Page -- Full Width</label>
</layout>
<layout id="category-full-width">
<label translate="true">Category -- Full Width</label>
</layout>
<layout id="product-full-width">
<label translate="true">Product -- Full Width</label>
</layout>
Looks like there is already a pull request #782 to fix this issue @unailopez16 what do you think about this propose solution?
Additionally testing this solution with luma on 2.4.3 seems to fix the issue.
Hello @jasperzeinstra,
Thanks for the report and collaboration!
The mentioned issue is not reproducible for us. Please refer to the below comment for more details:
https://github.com/magento/magento2-page-builder/pull/782#issuecomment-1895371820
Let us know in case we have missed anything.
Thanks