5

in Magento 1.x you could duplicate the extensions to app/design/frontend/themeName/default/template/or/layout and then modify it's layout or functionality via xml or phtml files.

How do we duplicate and edit certain modules now in M2? I have looked over the docs but couldn't find this info. For example i wish to edit phtml of module-catalog/view/frontend/templates/product/gallery.phtml correct way by having theme based module overwrite and now edit core modules within vendor/magento*/ folder.

Thanks for the help.

g5wx
  • 681
  • 1
  • 10
  • 21
  • 1
    You should view at http://magento.stackexchange.com/questions/91588/magento-2-0-how-to-override-the-phtml-in-vendormagentomodule-themeviewfron/91593#91593 . But you need change path of theme – LinoPham Dec 11 '15 at 09:25
  • 1
    if you want overwrite file in core. copy file with structure same in core pass into app/design. – xanka Dec 11 '15 at 09:27
  • Thank you both, exactly what i needed. Biil, can you pass that with an answer so i can mark it as correct? – g5wx Dec 11 '15 at 09:40
  • Ok. I reply again – LinoPham Dec 11 '15 at 09:48

1 Answers1

8

With version 2.0.0 release(not Github), You should do as below

Copy templates need to make override in:

vendor/magento/<module_name>/view/frontend/templates

Location contain templates using to override:

app/design/frontend/<Vendor_Theme>/<name_theme>/Magento_<module_name>/templates

Example

You want override a template in: vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

You create a file have path as: app/design/frontend/<Vendor_Theme>/<name_theme>/Magento_Catalog/templates/product/list.phtml

LinoPham
  • 3,778
  • 5
  • 22
  • 45