Closed cs221313 closed 8 years ago
Hi David! Does your theme inherit from the Blank theme? Did you apply your theme in the Admin? (in the configuration under CONTENT > Design > Themes)
Yes. My theme inherited from the Blank theme. When I changed the default.xml in Blank theme it works. But I put the code in my theme, it does not work.
What is the exact path name to the default.xml file you put in your theme? A common error is the path name is wrong and the file is not picked up as a result.
Here is a play theme I was trying (and works):
app/design/frontend/AlanKent/footerimage/Magento_Theme/layout/default.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="footer">
<block class="Magento\Framework\View\Element\Template"
name="footer.image"
before="-"
template="Magento_Theme::html/footerimage.phtml" />
</referenceContainer>
</body>
</page>
Something I do sometimes is to put a syntax error in and check the var/log directory. If there is no error, then its not finding you file.
My default.xml file is at: /app/design/frontend/MyNamespace/MyTheme/Magento_Theme/layout/default.xml
I modified the default.xml file to put a syntax error. but no error reported in log files. I don't know why my default.xml could not be found.
my _extend.less and _theme.less files could be found. But the default.xml could not be found. so weird.
Ok, so its clearly registered, you have selected it in Admin UI, but var/log/* is not reporting a syntax error when you put one into the file. Strange. I assume you have flushed all the caches again for good luck (including the three buttons under the big table)?
It worked after changing line endings to unix and encoding to utf8 in sublime - major problem here...
@IceReaper Thanks for sharing! Did you originally copy the code sample from our docs or no?
Copied several things together (also some stuff from the docs). Goal was to do exactly this: http://magento.stackexchange.com/questions/93628/magento-2-remove-and-change-footer-links Xml file kept not loading, tried so many things, wasted a whole day for this. So i used a sublime plugin to convert the file to utf8, unix line endings and then it suddenly worked.
Thanks!
After I debug the Theme.php file. I found my theme type is virtual. But the theme type should be physical.If the theme is virtual, this theme could not extend the parent theme. Does anyone know how to set the theme to physical?
Thanks a lot
After debugged the code. I got the reason why I can not extend my theme. It's because my type is 1 which is virtual type. I changed it to 0 which is physical type. It works now.
But the question is this type value is assigned automatically when I created that theme. I can not change it at the backend. Is there any other way to modify that value. because I don't think it's a good way to change the value at the DB directly.
Thanks
@cs221313 Great that you found the solution. But this is unusual. We cannot reproduce it. Could you post your theme files? (theme.xml, registration.php. composer.json) Thank you.
theme.xml
registration.php
<?php /**
composer.json
{ "name": "aimai/theme-frontend-whoo", "description": "N/A", "require": { "php": "~5.5.0|~5.6.0|~7.0.0", "magento/theme-frontend-blank": "100.0.", "magento/framework": "100.0." }, "type": "magento2-theme", "version": "100.0.2", "license": [ "OSL-3.0", "AFL-3.0" ], "autoload": { "files": [ "registration.php" ] } }
@cs221313 thanks, I was having the same problem, and my theme was also type = 1. changing to 0 allowed my default.xml to work.
Got same issue. Thanks for fix.
Can't reproduce one more time.
Same here, happend after migrating database to a separate installation. Thanks for the help!
Is there a related issue open for this? Surely we're not going to close this silent failing with no debug hints as ok
This happened again to me, seems that it's after I do an update.
Face the same problem as well on 2.1.2, after update at db from virtual to physical, it works just fine.
This happened to me as well when installing an extension. I made the change in the database. Is there a better way to handle this?
I like you. Can you help fix error no load file default.xml
Happened to me as well when installing an extension. It changed the physical theme to virtual theme.
yes is happening to me aswell using magento 2.3.0
I had the same issue with Magento 2.3.0.
Same issue in Magento 2.3.3 + Docker env. Changing type of theme to 0
helped.
Could somebody tell me why the theme gets set to virtual? I've just had this problem with 2.4 and it took me a while to solve. Changing the theme's type to 0
worked.
I was having the same issue. In my case, like @mswaidan, I changed the theme type = 0. And it works after that. Do you guys have any documents about this theme type? Thanks.
This issue popped up for us while using Magento 2.4.5, for a theme used in multiple environments, though this only affected one.
Hi, all,
I want to add a static block at the top of page. It works when I put the code in app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml. The content is as following:
It doesn't work. Can anyone can help me?
Thanks a lot
David