0

I found that I couldn't do anything with this element。

I even deleted the redis cache, and there was no catalog_ category_ View.xml is added with the move instruction, which still doesn't work.

The same is true in the topic. When the files are loaded, they can be accessed. At that time, in order to test whether these files are loaded, I deliberately wrote the wrong words, and the result is an error, indicating that these files have been loaded, but the operation element is invalid.

In My Module.

Aiweline/Catalog/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Aiweline_Catalog" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

2、Aiweline/Catalog/view/frontend/layout/catalog_category_view.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2018 Porto. All rights reserved.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <!--移动分类描述-->
        <move element="category.description" destination="category.products" after="category.products.list"/>
        <!--        <move element="category.description" destination="content.bottom" />-->
        <!--        <referenceBlock name="category.description" remove="true"/>-->
    </body>
</page>

3、Aiweline/Catalog/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Aiweline_Catalog',
    __DIR__
);

1 Answer 1

0

First of all for layout changes you need not to create Whole module, you can simply add catalog_category_view.xml to your theme directly under Magento_Catalog, also below should be the code for your xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="category.description" destination="content" after="category.products.list"/>
    </body>
</page>

Specially the destination should be content, destination="content" even if you want to use your own module for the same.

4
  • Yes, I have also tried to modify the theme. I also loaded the file but failed to successfully affect the layout Jul 30, 2021 at 9:58
  • I personally tried the above given layout update and it works fine, did you check if you have catalog_category_view.xml in your theme directory. Jul 30, 2021 at 10:37
  • Yes, yes, I put the move instruction in any catalog_product_view.xml file and it has no effect. Does this have something to do with the development mode? Aug 2, 2021 at 1:06
  • I found the problem, the proto theme modified the content in category.description, thank you! Aug 2, 2021 at 1:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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