File exchange . phtml on option change (Admin Magento)

Asked

Viewed 80 times

0

I have a module that I am doing and I have a doubt, follows:

My custom_module.xml is like that:

<layout version="0.1.0">
<default>
    <reference name="root">
    <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
            <action method="setTemplate">
                <template>customizefooter/footer.phtml</template>
            </action>
            </block>
    </reference>
</default>
</layout>

When the option is enabled Yes or In the within the configuration ADMIN of my module, it enables:

<?php if(Mage::getStoreConfig('my_module/options/enable_custom_paradox_html')): ?>
<?php echo Mage::getStoreConfig('my_module/options/Html_double_paradox'); ?>
<?php endif; ?>`

Beauty, with the Yes enabled it loads my new option along with the file set in setTemplate and the options defined therein.

But when I select the option NAY, it does not return to the original . phtml file, continues in mine and with the unchecked option. I need that when selected the option NAY it changes the . phtml to the custom standard and only when the option YES is enabled load my . phtml.

How do I proceed? Thank you

1 answer

0

From a researcher on the ifconfig xml of the user, is a condition if you are yes he executes.

Would something like this:

<layout version="0.1.0">
<default>
    <reference name="root">
        <block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
            <action method="setTemplate" ifconfig="my_module/options/enable_custom_paradox_html">
                <template>customizefooter/footer.phtml</template>
            </action>
        </block>
    </reference>
</default>
</layout>

Obs: I can’t test with the information you passed on, so here’s the tip from ifconfig only works in the action.

All my modules I use, in case I wanted to consult some examples: http://www.magentocommerce.com/magento-connect/catalogsearch/result/? q=dexxtz&pl=0

Use the freegento to download the source code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.