cancel
Showing results for 
Search instead for 
Did you mean: 

In what directory do child theme templates go

SOLVED

In what directory do child theme templates go

I am unable to find a clear description of how to determine the directory in which a customized template in a child theme should be put. My particular case is a customization of the file vendor/magento/module-catalog/view/frontend/templates/product/list.phtml , where I want to change the text displayed on a button. But I am also looking for more general rules about placing customized templates.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: In what directory do child theme templates go

You need to put your template in your theme at below location,

app/design/frontend/{Vendorname}/{themename}/Magento_Catalog/templates/product/list.phtml

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

6 REPLIES 6

Re: In what directory do child theme templates go

Hello @josiah_carberry

 

first of find current active theme  (https://www.youtube.com/watch?v=j-AWgnTJfU8)

 

you can find that theme under app/design/frontend/<theme package name>/<theme name>

 

in that you need to create Magento_Catalog folder

 

inside that folders templates

 

product/list.phtml

 

 

So all path is

app/design/frontend/<theme package name>/<theme name>/Magento_Catalog/templates/list.phtml

 

hope it will help you.

 

if works then mark as solution.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: In what directory do child theme templates go

Thanks for that.
I copied the original template into the indicated directory, customized
it, deleted pub/static/frontend/* and var/view_preprocessed/*, flushed
the cache, cleared the browser cache. The customized version does NOT
appear. I know that the template is the right one because I tested by
changing the original version - that worked as desired.

Re: In what directory do child theme templates go

Hello,

Some time module override it.
So move to develop mode and enable hit path. Based on that you will understand from that file comes.

Hope it will help you

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: In what directory do child theme templates go

I am already in develop mode and have already established, as indicated
previously, that the template has been correctly identified.

Re: In what directory do child theme templates go

You need to put your template in your theme at below location,

app/design/frontend/{Vendorname}/{themename}/Magento_Catalog/templates/product/list.phtml

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: In what directory do child theme templates go

Thanks very much.
It would be nice to see the general rule for figuring out where to put these templates.