5

I want to hide the large category image that shows on the category page. What phtml file and code do I need to edit?

2 Answers 2

15

Take a look these files:

- The layout

vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml

- Template

vendor/magento/module-catalog/view/frontend/templates/category/image.phtml

You can remove the image via layout in your custom theme. For example, in your custom theme:

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

<?xml version="1.0"?>

<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>
        <referenceBlock name="category.image" remove="true"/>
    </body>
</page>
3
  • Can we add the same code inside theme default.xml? Aug 21, 2018 at 12:14
  • @jafar I'm not sure about that. But, did you try? Aug 22, 2018 at 3:29
  • 1
    Yes, i tried it, It is working. Aug 22, 2018 at 6:26
0

Go to the following path and add <referenceBlock name="category.image" remove="true"/>

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

<?xml version="1.0"?>

<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>
        <referenceBlock name="category.image" remove="true"/>
    </body>
</page>

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.