Hi,
I am new to Magento and have just installed Magento 2.0. I want to use Luma as a starting point for my project but have a concern. If I do this, do I risk losing my work if the theme updates or somebody updates it via the dashboard?
Do I have to create a child theme to prevent this from happening? If so, how do you do this?
Thanks.
Hello @DAWS96
Yes ! that's correct, don't modify core LUMA theme files and don't do directly customization on the LUMA theme.
Instead of that you will require to override that theme in your custom/child theme.
In the app/design directory - you will require to create a custom theme and do the necessary customization over there only ! then even though you update the LUMA theme then your changes remain as it is.
Below i am sharing the link for you reference - that how to create/override custom theme from the parent theme LUMA.
https://www.dckap.com/blog/how-to-create-child-theme-in-magento2/
https://magento.stackexchange.com/questions/108684/how-to-create-a-child-theme-in-magento-2
You can also refer this link for inheritance existing theme in custom theme - https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-inherit.html
Hope it helps !
Hi @Manthan Dave,
Thank you for the fast response! I'll take a look at the articles you provided and try create a child theme later on today.
Can I ask, using a child theme of LUMA - will this limit what I can do with Magento or are the themes completely adaptable?
Thanks,
Dan
Hello @DAWS96 (DAN)
Off Course this is adaptable.
There is no limitation at all if you create a child/custom theme !
You can use all the available functionality of Magento with your child/custom theme.
Hope it helps !
Hi @Manthan Dave,
I have finally created a child theme but have one question. If I want to style the theme using LESS, do I create another .LESS file or add it all directly to _theme.less?
I have created a _extends.less file located: /public_html/magento/app/design/frontend/JMC/luma_child/web/css/source/ and trying to add my custom CSS here but it isn't showing on the front-end. Am I missing something?
Hello @DAWS96
After creating CSS - have you run the - php bin/magento setup:static-content:deploy -f command ?
You will require to run that command after creating the css file !
Also you will require to add your css file into the default xml file of your theme !
I am sharing the reference link to give you more idea - how to add css in your custom theme and it will showcase your css effect as well - https://zemez.io/magento/support/how-to/magento-2-quick-guide-create-custom-css-file/
https://zemez.io/magento/support/how-to/magento-2-quick-guide-create-custom-css-file/
let me know if you are still facing any issue !
Hope it helps !