3
votes

I am currently trying to set up a multi store version of Magento, that will localised to different countries.

I am trying to specify different xml blocks based on which store front is in use. For example on the British version, show british images, french one, show french images etc.

I have the following in a local.xml file but it doesnt seem to change items, the tags are working though, if i put in a remove header tag for example it will remove the header block from that storefront.

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
      
    </default>
  
    <cms_index_index>
      <reference name="root">
        <block type="banner/banner" name="banner_home_main" template="unibanner/banner-file.phtml">
          <action method="setData">
            <name>banner_group_code</name>
            <value>home_page_main</value>
          </action>
        </block>
      </reference>  
  </cms_index_index>
  
  <STORE_name_uk>
    <cms_index_index>
    <reference name="root">
      <action method="unsetChild"><name>banner_home_main</name></action>
      
      <block type="banner/banner" name="banner_home_main" template="unibanner/banner-file.phtml">
        <action method="setData">
          <name>banner_group_code</name>
          <value>home_page_main_uk</value>
        </action>
      </block>
    </reference>
    </cms_index_index>
  </STORE_name_uk>
  
</layout>
1

1 Answers

1
votes

To do this, you don't need to remove blocks, you simple override them in the STORE_ handle XML.

So in your main local.xml (the one from the main store), put something like this:

<STORE_name_uk>
    <reference name="root">
        <block type="banner/banner" name="banner_home_main" template="unibanner/banner-template.phtml">
            <action method="setData">
                <name>banner_group_code</name>
                <value>home_page_main_uk</value>
            </action>
        </block>
    </reference>
</STORE_name_uk>

For some reason, I also had to set the "as" value on the initial block declaration