0

There is a phtml file from a module that I want to override in my theme. The path to the file is: \vendor\mageplaza\magento-2-social-login\view\frontend\templates\form\social.phtml.

I am trying to figure out what the path should be to my override social.phtml file but I am finding it confusing. What is the correct path I should put my file?

2 Answers 2

0

You can override social.phtml by below path

app/design/frontend/YourTheme/Vendor/Mageplaza_SocialLogin/templates/form/social.phtml

Example :

As per Magento-2 if you want to override vendor module templates then you need to follow an example

Vendor Module : mageplaza\magento-2-social-login

You need to make this directory in your theme like below

app/design/frontend/YourTheme/Vendor/ : Mageplaza_SocialLogin

and module view templates \view\frontend\templates\form\social.phtml is under in theme templates folder like : templates/form/social.phtml

Finally your template path is :

app/design/frontend/YourTheme/Vendor/Mageplaza_SocialLogin/templates/form/social.phtml
4
  • How would I have worked that out? The path and names are structured differently, what is the rule you followed to get the correct path?
    – Guerrilla
    Commented Jun 22, 2017 at 7:32
  • You need to follow magento-2 theme rules. Commented Jun 22, 2017 at 7:33
  • 1
    That is not a helpful answer. Your path does not seem to match, you captitalized some letters and removed hypen. I cannot find any documentaion saying to do that
    – Guerrilla
    Commented Jun 22, 2017 at 7:34
  • Check my updated answer with example. Commented Jun 22, 2017 at 7:43
1

We can use the same format what we use to override core Magento files into our theme.

Under your theme folder, Create a directory with name Package_Module. So, in your case, Please create a directory named Mageplaza_SocialLogin

Put the files following the same path what the base module have and paste the template files under the template directory. It will look like following:

app/design/frontend/YourTheme/Vendor/Mageplaza_SocialLogin/templates/form/social.phtml

Please refresh cache to get the changes.

2
  • where do you get the module name? The path says "mageplaza\magento-2-social-login" not "Mageplaza_SocialLogin". Did you get that from somewhere else?
    – Guerrilla
    Commented Jun 22, 2017 at 10:40
  • mageplaza is your Package name, magento-2-social-login in your module name. while overriding the files to our theme, you have to follow this standard, use camel case format. So it will change to Mageplaza_SocialLogin. I took reference from github. github.com/mageplaza/magento-2-social-login/blob/master/… Commented Jun 22, 2017 at 12:52

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.