Custom RWD theme falling back on base theme instead of rwd
-
29-09-2020 - |
Question
I'm trying to create a custom RWD theme with magento 1.9 and for some reason even after following this guide:
https://www.flinttechnology.co.uk/customising-rwd-magento-responsive-theme/
Its using the base theme as the fallback instead of the RWD theme.
Solution
UPDATE
As @ProxiBlue pointed my mistake, you need to put this in your theme/etc/theme.xml
<?xml version="1.0"?>
<theme>
<parent>rwd/default</parent>
</theme>
and have empty in default
section, unless you have default
theme in your theme package.
Things to understand of fallback of magento theme
You should have RWD in "Default" section of system > configuration > design > theme
. This will make sure your theme will fallback to this theme.
Points to remember
- When there is no required
.phtml
file exist in RWD theme, then it will again fall back to base theme. - Not all
.phtml
files exist in RWD theme, some of them extend frombase
theme. - Same thing for
css or js or image
files.
Hope this helps you.
More reading:
- http://alanstorm.com/magento_infinite_fallback_theme_xml
- http://www.classyllama.com/blog/depth-look-magento-theme-fallback
Why there is no style applied?
When it is falling back to base it tries to find those styles, since they don't exist there, it is unable to style your html. It totally make sense. Right click on browser and do inspect element, you will see those css/js/image files thrown as 404 not found error.
OTHER TIPS
From the comments, I gather your theme fallback xml is not correct.
The file should contain proper xml, with a <parent>
directive.
<?xml version="1.0"?>
<theme>
<parent>rwd/default</parent>
</theme>
It looks like the resource you are working from has some issues with the display of the formatted xmlon their blog entry
This is most likely why you thought you only need to have the text 'rwd/default' in the theme.xml file, without any directives.