2

I'm trying to remove the description block via:

app/design/vendor/module/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>
    <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Category\View"
               name="children_category_imgs"
               template="category/children_category_imgs.phtml"
               before="category.products"/>
    </referenceContainer>

    <referenceBlock name="catalog.compare.sidebar" remove="true"/>
    <referenceBlock name="category.image" remove="true"/>
    <referenceBlock name="category.description" remove="true"/>
</body>

vendor\magento\module-catalog\view\frontend\layout\catalog_category_view.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>
    <referenceContainer name="columns.top">
        <container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-">
            <block class="Magento\Catalog\Block\Category\View" name="category.image" template="Magento_Catalog::category/image.phtml"/>
            <block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml"/>
            <block class="Magento\Catalog\Block\Category\View" name="category.cms" template="Magento_Catalog::category/cms.phtml"/>
        </container>
    </referenceContainer>
....
</page>

enter image description here

I have sucessfully removed the image using the same method.

2
  • Have you flushed Magento cache after adding code for removing category description? Dec 5, 2018 at 12:41
  • Yes, I have flushed Magento Cache, even compiled again.
    – Raül
    Dec 10, 2018 at 7:50

1 Answer 1

3

app/design/frontend/Company_Name/Theme_Name/Magento_Catalog/layout/catalog_category_view.xml

<referenceBlock name="category.description" remove="true"/>

Just clean the cache

php bin/magento cache:clean
1
  • As I say in the problem, I have already done this but it does still not work.
    – Raül
    Dec 10, 2018 at 7:52

Your Answer

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

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