I want to use drupal_add_js
and drupal_add_css
on a per-page basis so I have added a 'scripts' text field to my basic content type and have set the Format Type to PHP.
It works beautifully until I turn js/css aggregation back on; then, none of the files I specified are loaded. Why?
- Because Drupal is still using the previously aggregated files (despite me flushing the cache many times).
- Because of some more sinister issue that will prevent me from adding my CSS/JavaScript in this manner.
I see other people doing the same thing here: https://drupal.org/node/290982.
drupal_add_js()
in template files or in PHP filters in the UI, that will definitely stop it being aggregated as alexkb's answer notes – Clive♦ Jun 7 '13 at 15:00