0

I would like to move category.cms block from "category-view" to "columns".

I tried to do this:

  1. mkdir -p app/design/frontend/Vendor/Namespace/Magento_Catalog/layout/
  2. nano app/design/frontend/Vendor/Namespace/Magento_Catalog/layout/catalog_category_view.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="category.cms" destination="content" after="-">
   </body>
</page>
  1. Clear cache and refresh page.

Nothing change from my theme. I use Magento 2.4 Luma

Thanks

0

Try:

<move element="category.cms" destination="columns" after="-" />
3
  • Hi, only <move tag or <page...><body><move...></body></page>? not works
    – Filippo
    Mar 16 at 20:06
  • Always add details of code like files to edit and line Or code section.
    – Jarnail S
    Mar 16 at 20:24
  • In this way? Not works <page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <move element="category.cms" destination="columns" after="-"> </body> </page>
    – Filippo
    Mar 17 at 9:24
0

You have created your layout file in wrong path you should add file in below path

app/design/frontend/Vendor/Namespace/Magento_Catalog/layout/catalog_category_view.xml

Add below code to move "category.cms" block.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="category.cms" destination="columns" after="-"/>
    </body>
</page>

FYI:- this block already called in columns.top in magento 2.4 luma theme. So you can add block name in before/after as per you want to set.

3
  • Sorry but I forgot the write Magento_Catalog/ on the path. Not work...
    – Filippo
    Mar 18 at 11:45
  • I have practically checked in magento 2.4.1 version and it is working properly. You should try to call this code in default file(vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml) first to check that it is working or not. If it is moved from default file then it is problem with the file creation in your theme.
    – ZealousWeb
    Mar 18 at 11:56
  • First please put code <move element="category.cms" destination="columns" after="-"/> in body tag in default file vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml
    – ZealousWeb
    Mar 18 at 11:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.