Hey there,
I added a new Theme for my project, wich worked good. The Theme is enables in Backend and it extends the Magento/Luma Theme. I didnt overwrite anything, so it should look like the Luma Standard Theme. I published all statics and flushed caches. My frontend lookes like the blank theme right now, but it should look like the luma, shouldnt it?
My theme.xml lookes like the following:
regards, David.
The Luma theme also makes extensive use of CMS blocks, which do not inherit with blocks (we are discussion internally if this is a bug or feature). The Luma theme is _not_ designed to be inherited from - it is purely developed as a demo store for people to explore and play with - so they tried to demonstrate CMS blocks instead of doing it in the theme (which would then have been inheritable).
So it is expected that the home page won't have all the CMS blocks if you develop a new theme that inherits from Luma. We do not recommend inheriting from Luma.
Thanks! I will build up my theme without Luma. But there is another question. There is a new table which is called themes. A column named parent_id represent the themes parent. No matter what I write in my theme.xml, the parent_id of my theme is the id of the blank theme. How can I set this flag and do I should set this flag?
It works OK for me... See the 'winter' theme (with sample theme.xml below) inheriting from new-png-logo.
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Snow in Winter</title>
<parent>AlanKent/new-png-logo</parent>
</theme>
@DavidLambauer, the issue with wrong parent theme might occur on editing a theme which is already installed in the table. But it is already fixed and delivered to public (internal ticket MAGETWO-43188, see 7dc9e60, 0aeac1b). Please check whether the issue is still occurring.
So, if we really like Luma and just want to customize it a bit, is there a way of making a custom theme that replicates luma instead of inheriting from it?
Copy can cp the directory tree of the theme and start hacking. Obviously you wont get updates if we patch Luma - that might be a good or bad thing depending on your needs. Just change the theme name strings in files like composer.json, registration.php, and theme.xml in your copy. (Look for Magento/luma combinations and change to your vendor/theme name.)
thank you for the reply! I've been having a rough time out on stackexchange getting help! Interesting, so I cloned the luma theme to its own folder, changed those things, added a custom css file and a few js files to the default head blocks xml, and cleared everything, loaded it, and when I do... the theme works, but does not load my custom css or js files... very weird. (I did it 4 times separately just to be sure I wasn't missing anything)
I'm happy to make a new thread if I need to, didn't really mean to hijack this one :) I'm just trying to clone Luma, and make some css overrides - but every time I try, it will not load my custom CSS or JS from the default head blocks... it's really weird... I'm really hoping for some help here, I am an experienced web developer, but obviously new to Mage2, and I just can't seem to get this thing working, and I've been just pulling my hair out, and I'm on a tight timeline to get my site up :/ - thanks in advance for any assistance! :)
I had this same custom CSS issue extending Luma which turned out to be the 'type' field in the 'theme' database table. The 'type' was set to 1 (virtual) and changing to 0 (physical) and flushing cache resolved the problem. I'm not sure how the type got set to virtual.
"The Luma theme is not designed to be inherited from"?
This was a rather silly decision - surely the included themes should absolutely be inheritable?
@slavvka Now that official opinion is that Luma can be inherited from,
would it be worth it making the styles of luma easier to access or deploy in a theme without installing the sample data.
For example the "tiles" css used in luma are not in less but just static css that I could see - is that something that would be worth converting into a less file in the ui library?
Most helpful comment
"The Luma theme is not designed to be inherited from"?
This was a rather silly decision - surely the included themes should absolutely be inheritable?