CMS block in XML layout with more storeviews (using layout and page) Magento

Posted: January 29, 2015 in All Category, Magento

Layout Handle 

<STORE_de>
    <reference name="left">
        <block type="cms/block" name="Promo_de">
            <action method="setBlockId"><block_id>promo_de</block_id></action>
        </block> 
    </reference>
</STORE_de>
<STORE_en>
    <reference name="left">
        <block type="cms/block" name="Promo_en">
            <action method="setBlockId"><block_id>promo_en</block_id></action>
        </block> 
    </reference>
</STORE_en>

Page Handle 

if( Mage::app()->getStore()->getCode() == 'de' ) { echo $this->getLayout()->createBlock('cms/block')->setBlockId('promo_de')->toHtml(); } else if( Mage::app()->getStore()->getCode() == 'en' ) { echo $this->getLayout()->createBlock('cms/block')->setBlockId('promo_en')->toHtml(); }
Advertisements

Comments are closed.