Magento add javascript, js, or css based on configuration
Are you working on your brand new module which needs some JS or CSS included in the <head> section only if some config settings are made?
There are a few ways to accomplish this, but the simplest one is this one (Example for JS file located in /js folder. Use the appropriate method to include skin_js or skin_css):
in your local.xml or layout update file add
<layout> <default> <reference name="head"> <action ifconfig="path/to/configuration" method="addJs"> <script>pathto/script.js</script> </action> </reference> </default> </layout>