Magento – Child theme and fallback not working

theme

I've followed the instructions here for setting up a child theme. http://alanstorm.com/magento_parent_child_themes

The problem is that even when I set my theme's XML it doesn't fall back to rwd. In fact I don't even think my theme is loading at all.

I created the following:

/app/design/frontend/carl/default/etc/theme.xml

I then changed the package from the default 'rwd' to 'carl'

These give me a homepage with no style at all. So I created a theme.xml containing:

<?xml version="1.0"?>
<theme>
<parent>rwd/default</parent>
</theme>

I reloaded my front page, but still it has no style at all. The correct behaviour should be to fall back to the rwd theme.

All cache is disabled, but I've still flushed it anyway.

On loading the homepage there is no reference to my theme at all.

Best Answer

The reason why is that Magento is looking only at your current theme and not really pulling from the parent. In order to do so you have to apply updates like so

parent theme

<?xml version="1.0"?>
<theme>
    <parent>rwd/default</parent>
    <layout>
        <updates>
            <wsu_base>
                <file>wsu_base_defaults.xml</file>
            </wsu_base>
        </updates>
    </layout>
</theme>

Child theme

<?xml version="1.0"?>
<theme>
    <parent>wsu_base/default</parent>
    <layout>
        <updates>
            <wsu_base>
                <file>wsu_base_defaults.xml</file>
            </wsu_base>
            <foundation_default>
                <file>defaults.xml</file>
            </foundation_default>
        </updates>
    </layout>
</theme>

You can read more on this from http://alanstorm.com/magento_infinite_fallback_theme_xml. Note that I have found that the css of the child is still getting skipped and have a question in on that.

Related Topic