3

I wish to do some customization in luma theme (default.xml).

I just created the default.xml file as specified below but it is not taking any effect.

default.xml

Note sure is this the correct way to override the theme???

1 Answer 1

2

You must create and register a new theme:

enter image description here

You just need to create 2 files theme.xml and registration.php these are the examples for the theme in the image (Dayds). You should change that name for your own.

app/design/frontend/Dayds/default/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Dayds/default',
    __DIR__
);

app/design/frontend/Dayds/default/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>DAYDS . Default</title>
    <parent>Magento/luma</parent>
</theme>

Then go to the backend and activate your new theme for the desired store.

6
  • Thanks. I created a theme as you said and enabled it for my store. cleared the cache. But the changes I do in default.xml (for Ex: I set report.bugs to remove false just to check) and it is not reflecting in the front-end. But if I edit the luma default.xml directly it works. Commented Jan 30, 2016 at 19:36
  • 1
    In magento2 frontend design it's a real pain in the back, at least for me... you must remove cache, but need to remove var/view_generated and static/frontend almost every time you made a change. I deal with this a few hours until got some results. Try to change the logo filename should works. Commented Jan 30, 2016 at 19:42
  • BTW I had that example just working fine a few days, and after remove some modules (like shipping and payments gateways that I wont use) just stopped work. I had to reactivate all modules in order to get it working again. Commented Jan 30, 2016 at 19:45
  • Thanks. I guess I am getting closer... Can you also explain me how to uninstall the theme??? I just removed the folder but still the dropdown shows the created theme... Commented Jan 30, 2016 at 20:13
  • Yes! just remove your theme record from the theme table. Note that, for some reason - you must respect the case that way: ThemeVendor > theme_name Commented Jan 30, 2016 at 20:15

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.