Last Updated: February 25, 2016
· danhanly

Include Asset in Specific Magento Route

Want to include a JS or CSS file in your Magento theme but only for a specific page? Easy. Just add the following to your layout file:

    <reference name="head">
        <action method="addCss">

In this example, route_name would be your underscore separated route which is normally defined in your module e.g. module_controller_action as in adminhtml_dashboard_index or catalog_category_view