I'm trying to override Magento_Catalog list.phtml in magento 2.1.6 and it's not working. I have a theme working and others templates and layouts overrides are working correctly.

My custom list.phtml is here:


If I remove "category.product.list" in my "catalog_category_view.xml" in


with this funcion:

<referenceBlock name="category.products.list" remove="true" />

product grid disappears.

I've tried also to disable modules but it's not working.

I'm doing tests modifying list.phtml line 68 link class:

    <a class="product-item-link test"

And in my grid isn't showing this change.

  • Check if any module is overriding this phtml and taking preference over theme.
    – Sejal Shah
    Commented Jun 1, 2017 at 7:38

3 Answers 3


Since when doing reference for removing it works , i m guessing that you are using the current active theme.

Make sure you are in developer mode and then I would try to clean pub/static and var/view_preprocessed and redeploy static content. If this doesn't work try and extend the layout. In app\design\frontend\vendor\theme\Magento_Catalog\layout\catalog_category_view.xml

<referenceContainer name="content">
        <block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
            <block class="Vendor\Module\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
...... rest of file depending on what you are extending

I had to extend ListProduct.php for different reasons so i don't know if it works with default but this is working for me.

  • Overriding block by XML it's working. But I changed: <block class="Vendor\Module\Block\Product\ListProduct" .... for: <block class="Magento\Catalog\Block\Product\ListProduct" because I don't have any module overriding ListProduct.php Commented Jun 1, 2017 at 7:39

To override a template you only need to move it into your theme, the XML you have written is removing the template so it will no longer be rendered.

Remove the line with remove="true" and clear cache and Magento should use your template.

  • XML update it's a test. It's only for check the template overriding it's working. The problem is with list.phtm. Commented Jun 1, 2017 at 7:31

if you remove block than you cant use same block for custom list file.

<referenceBlock name="category.products.list" remove="true" />

so you have to use this Layout with your custom block name and custom-list.phtml

    <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
            <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list.custom" as="product_list" template="Magento_Catalog::product/custom-catalog-list.phtml">
                <container name="category.product.list.additional" as="additional" />
                <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                    <block class="Magento\Framework\View\Element\Template" name="category.product.type.details.renderers.default" as="default"/>
                <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare"
                           name="category.product.addto.compare" as="compare"
                <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
                    <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
                <action method="setToolbarBlockName">
                    <argument name="name" xsi:type="string">product_list_toolbar</argument>

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.