1

I m overriding result phtml template using my custom theme.

Here is what i have done

In my

   app\design\frontend\MyTheme\tagtheme\Magento_CatalogSearch\templates\ 

i have copied result.phtml from CatalogSearch view template folder.

I get log as :

[2016-08-18 12:54:13] main.CRITICAL: Invalid template file: 'result.phtml' in module: 'Vendor_Module' block's name: 'search.result' [] []

Should i have to override the layout file as well?

0

When overriding or re-using the Magento default templates in our custom module, we need to have a module prefix which corresponds with the templates. For example: Vendor_Module::result.phtml or Magento_CatalogSearch::result.phtml.

  • Where do we give that...Cause they say no need of xml when yu are overriding the phtml template using the theme method – Sushivam Aug 18 '16 at 13:24
  • You have a module Vendor_Module? – Khoa TruongDinh Aug 18 '16 at 13:25
  • Yes...in Vendor_Module i had catalogsearch_result_index.xml which i removed after copying the phtml file from view layout to my theme – Sushivam Aug 18 '16 at 13:28
  • Now my Vendor_Module view frontend has nothing, but my templates are in the above path shown – Sushivam Aug 18 '16 at 13:29
  • Try to disable this module, flush Magento Cache, delete var/generation, var/view_preprocessed, may delete static content and try to rebuild again. – Khoa TruongDinh Aug 18 '16 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.