Log in or create an account
If you have an account with us, please log in.

You have no items in your shopping cart.

Frequently Asked Questions

How can we help you?

banner image

How to add the Custom Layout Update on Magento 2.3.4?

In Magento 2.3.4, there is no more the Layout Update XML field in the admin panel. Instead of it, you will find the Custom Layout Update dropdown on the CMS Page Edit, Category Edit, and Product Edit pages. It was done to increase the security level of the system.

Now, to make a custom layout, you need to create a file and place it on the server in the module or theme folder, for example, app/design/frontend/THEME/LOCALE/layout. Then you will be able to choose its name from the list in the admin panel. Magento loads all layouts and looks for those among them that meet the following conditions:

1) For product pages: catalog_product_view_selectable_PRODUCT_SKU_ANYNAME.xml

For example catalog_product_view_selectable_24-MB01_CUSTOM.xml

custom layout update in magento 2.3.4 example

Check vendor/magento/module-catalog/Model/Product/Attribute/LayoutUpdateManager.php to get additional data.

2) For category pages: catalog_category_view_selectable_CATEGORYID_ANYNAME.xml

For example catalog_category_view_selectable_5_CUSTOM.xml

custom layout update in magento 2 example

Go to vendor/magento/module-catalog/Model/Category/Attribute/LayoutUpdateManager.php for more details.

If you already had some Layout Update on the previous Magento version, you will see the Use existing option. It means your previous layout was saved, and you can use it on the frontend. If you try to add or change this Layout Update, you will get the following error:

“Custom layout update text cannot be changed, only removed”

Check the official documentation to learn about other Magento 2.3.4 changes.

Rate the answer?

Total rating: 5.0

If you didn’t find the answer on your question, please, ask here:

Back to top