1

I have a store with 2 languages arabic and english, and I want a phtml for arabic and another one for english

Can I do something like:

    <ar>
        <reference name="footer">
            <action method="setTemplate">  
                <template>page/html/footer_ar.phtml</template>
            </action>
        </reference>
    </ar>

and

    <en>
        <reference name="footer">
            <action method="setTemplate">  
                <template>page/html/footer_en.phtml</template>
            </action>
        </reference>
    </en>

the store code is base, english is default and arabic is eg_ar

1

Magento is create unique Handler receptively each store whenever frontend page is rendered.

Handler format is STORE_YOURCURRENTSTORECODE

See at Mage_Core_Controller_Varien_Action class on function addActionLayoutHandles

$update->addHandle('STORE_'.Mage::app()->getStore()->getCode());

That means whenever arabic and english store are rendered then create

STORE_en & STORE_ar handler respectively

Now just change the handler

  • ar to STORE_ar

and

  • end STORE_en

    <STORE_ar> <reference name="footer"> <action method="setTemplate">
    <template>page/html/footer_ar.phtml</template> </action> </reference> </STORE_ar>

and

<STORE_en> <reference name="footer"> <action method="setTemplate">
<template>page/html/footer_en.phtml</template> </action> </reference> </STORE_en>

Hope this will resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.