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.

asked Dec 11, 2015 at 9:19
4
  • 1
    You should view at magento.stackexchange.com/questions/91588/… . But you need change path of theme Commented Dec 11, 2015 at 9:25
  • 1
    if you want overwrite file in core. copy file with structure same in core pass into app/design. Commented Dec 11, 2015 at 9:27
  • Thank you both, exactly what i needed. Biil, can you pass that with an answer so i can mark it as correct? Commented Dec 11, 2015 at 9:40
  • Ok. I reply again Commented Dec 11, 2015 at 9:48

1 Answer 1

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

answered Dec 11, 2015 at 9:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.