Вопрос

I am working on a Magento 2.1.7 shop and I have created a child-theme of Magento Blank.

I need to eliminate the category image and description, more exactly the <div class="category-view"><!-- More code here --></div> element from the category page.

The file to edit, if I am not wrong, is app/design/frontend/Company_Name/Theme_Name/Magento_Catalog/layout/catalog_category_view.xml.

What is the piece of code I have to edit in order to eliminate the category image and description?

Thank you!

Это было полезно?

Решение

Try adding below code in your

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

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

Другие советы

I have removed the block that contains both of them this by adding remove="true" to the columns.top element.

<referenceContainer name="columns.top" remove="true">
     <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>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top