I have a theme with several template files using <?php print $scripts ?>
to load a list of scripts set in the theme's .info file. What's the best way in Drupal 6 to exclude one of the scripts from being loaded in certain template files?
I do not think there's a way to really un-set scripts once they've been added, in D6. D7 provides hook_js_alter, but not D6.
Do you have control over the theme? Your best bet would be to remove the scripts from the .info file and only add them as needed by calling drupal_add_js(). Which hooks or preprocessors you need to use to make those calls to drupal_add_js() will be something determined by the purpose of the scripts themselves. But you'll want them added before template_preprocess_page() is called since that's where the $scripts variable is generated.
-
2
-