3

I've created a theme package called hoi with a default theme. In the app/design/frontend/hoi/default/etc/theme.xml I've set a parent theme to be the a theme we purchased called blacknwhite.

This almost works but it does not pick up the layout.xml from the blacknwhite theme as my own theme's xml overwrites it. It works when I copy and paste the contents from the blacknwhite theme's xml into my own theme's xml. But I would rather not do this as so I tried to create a new layout update in my theme's theme.xml.

theme.xml

<theme>
    <parent>blacknwhite/default</parent>
    <layout>
        <updates>
            <hoi_default>
                <!--should be linking to app/design/frontend/hoi/default/layout/parentslocal.xml-->
                <file>hoi/parentslocal.xml</file>
            </hoi_default>

            <hoi_default>
                <!--should be linking to app/design/frontend/hoi/default/layout/local.xml-->
                <file>hoi/local.xml</file>
            </hoi_default>
        </updates>
    </layout>
</theme>

This way I hoped to have my own local.xml for my theme which would fall back onto a parentslocal.xml which I would then copy the contents of the parents local.xml to. But it's not working.

I tested it by putting the below in my local.xml but it did not work.

<layout version="0.1.0">
    <default>
        <reference name="header">
            <remove name="cart_sidebar"/>
        </reference>
    </default>
</layout>

I would have thought Magento would inherit from it's parent's theme more seamlessly.

I'm thinking it is perhaps better off putting my sub theme in blacknwhite/hoi!

4
  • So 2 small things, first of all I'm not sure if it allows you to define <hoi_default> twice. Second, you cannot name the file local.xml. I forgot the source but I can remember that you need to give it another name Jun 24, 2015 at 18:33
  • @SanderMangel, even when I add just hoi/parentslocal.xml it doesn't pick up the layout updates in hoi/parentslocal.xml. I think my syntax must be wrong
    – Holly
    Jul 7, 2015 at 9:18
  • is this test is possible for run in magento?
    – test
    Sep 17, 2018 at 8:48
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review Sep 17, 2018 at 9:31

1 Answer 1

3

I found the problem was with my syntax, as per Alan Storms post on infinite theme's fallaback the proper syntax is:

<?xml version="1.0"?>
<theme>
    <parent>rwd/enterprise</parent>
    <layout>
        <updates>
            <my_new_file_name>
                <file>my_new_file_name.xml</file>
            </my_new_file_name>
        </updates>
    </layout>
</theme>

So in my case this meant I needed:

<theme>
    <parent>blacknwhite/default</parent>
    <layout>
        <updates>
            <parentslocal>
                <!--should be linking to app/design/frontend/hoi/default/layout/parentslocal.xml-->
                <file>parentslocal.xml</file>
            </parentslocal>
        </updates>
    </layout>
</theme>

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.