문제

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