.phtml file change in change of option (Magento Admin)

0

I have a module that I'm doing and I have a question:

My custom_module.xml is 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">
                <template>customizefooter/footer.phtml</template>
            </action>
            </block>
    </reference>
</default>
</layout>

When Yes or No is enabled within the ADMIN configuration 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; ?>'

Yes enabled it loads my new option along with the file set to setTemplate and the options that have been set in it.

But when I select the NOT option, it does not return to the original .phtml file, it continues on mine and with the option cleared. I need it when the NO option is selected it changes the .phtml to the custom default and only when the YES option is enabled load my .phtml.

How do I proceed? Thanks

    
asked by anonymous 10.03.2015 / 09:42

1 answer

0

From a search of the ifconfig of the magento xml, it is a condition if yes it executes.

It would look 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>

Note: I can not test with the information you passed, so the ifconfig hint only works in action .

>

All my modules I use, if you wanted to see some examples: link

Use freegento to download the source code.

    
08.04.2015 / 13:23