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?
2 Answers
There is a big job to do:
First you have create your Magento theme mageplaza tuto or other.
After creating your custom theme correctly, you can customise it (adding your
css
,js
)About the
html
, in Magento they arephtml
and it depends what it contains these files, if they areheader
,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? Commented Sep 11, 2018 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ƎCommented Sep 11, 2018 at 10:54
-
You're welcome, if it's ok for you, thanks to accept the answer– PЯINCƎCommented Sep 11, 2018 at 11:33
You need to create theme as described in mageplaza , 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 )