I am new to magento development can you help me how to override grid.phtml which resides in


I need to customize this template from my module. but i am not understand how to override this file, where to put and all.

1 Answer 1


You can replace the grid.phtml where you call the widget like below

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" title="Our Products" products_count="8" template="Namespace_Modulename::product/widget/content/grid.phtml"}}

Reference: Magento2: How to override widget template


You can override this template by coping grid.phtml file in below path.

New file path for your theme: mytheme/Magento_CatalogWidget/templates/product/widget/content/grid.phtml

Hope it helps!!!

  • where i can put this code
    – Dev
    Commented Sep 14, 2019 at 10:57
  • Where you call your widget in Magento Admin.
    – Sumit
    Commented Sep 14, 2019 at 11:00
  • is there any way i can override this programatically?
    – Dev
    Commented Sep 14, 2019 at 11:01
  • You can do it on theme level. Please check my updated answer.
    – Sumit
    Commented Sep 14, 2019 at 11:03
  • is this work on cutom module/themes?
    – Dev
    Commented Sep 14, 2019 at 11:27

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.