0

I have a theme folder where there are only html, css and js file are contained. I want to convert my current theme using those css files into magento 2.can i do this or will i have to make new theme?

1

You need to create theme as described in Dev Docs , the theme folder you are talking about is not magento theme this would be better called html markup.

You can use your markup css/less and js files ( html classes ) in magento theme files ( js, css phtml / xml etc )

1

There is a big job to do:

  1. First you have create your Magento theme mageplaza tuto or other.

  2. After creating your custom theme correctly, you can customise it (adding your css, js)

  3. About the html, in Magento they are phtml and it depends what it contains these files, if they are header, content, footer etc... you have to update that original ones from the new theme that you have just created

Exemple : to update the header, you have to go to : vendor/magento/module-theme/view/frontend/templates/html/header.phtml, you copy it then you past it in your new theme : app/design/frontend/{Theme}/{name}/Magento_Theme/templates/html/header.phtml why do we do this ?

  • because your new theme is inherited from his parent.

  • it's forbidden to update the Magento core files, vendor/magento/...

  • every time you need to edit a core templates file, you copy it from there and past it in your custom theme.

More informations in Magento DevDoc.

  • Thanks for reply. if i make that files magento 2 require to create new theme like registration.php,jason etc. and then add my own html file code there then will it be executable or not? like <html> <head></head> <body>bhlaa bhalla bhalj</body> </html> also its related css and js. And paste into the custom theme folder with file name then will it be executable or not? – Yawar ALI Sep 11 '18 at 10:46
  • yes since you have created your theme, you can customise his files but if you have page that doesn't exsist you have to create it according to the Magento conception – PЯINCƏ Sep 11 '18 at 10:54
  • You're welcome, if it's ok for you, thanks to accept the answer – PЯINCƏ Sep 11 '18 at 11:33

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.