Im creating a module where in the admin i have created options to enable/disable a block in the header.
So i planned on using ifconfig to show the block or not depending on the admin value.
Ive declared the block and it shows as should but im struggling to get the ifconfig to work. I understand it can only be used on action tags.
So my question is how do i show my block depending on the config value?
Heres my current xml:
<reference name="header">
<block name="untitled.social.footer.links" as="social_footer" template="untitled/social/links.phtml"/>
<action method="setChild" ifconfig="untitled_social/platforms/footer_enabled">
<alias>social_footer</alias>
<block>untitled_social/platforms</block>
</action>
</reference>
This doesnt work at the moment, so where am i going wrong?
Cheers
** EDIT **
Following Johnathon's suggestions below if have amended my code which now looks like this:
Layout XML
<layout>
<default>
<reference name="footer">
<action method="setChild" ifconfig="social/platforms/footer_enabled">
<alias>social_footer</alias>
<block>untitled_social/platforms</block>
</action>
</reference>
</default>
</layout>
Construct in my block php file
public function __construct()
{
$this->setTemplate('untitled/social/links.phtml');
}
Unfortunately it's still not showing. How can i check the returns value of the ifconfig?
Thanks