I’m defining my scripts in my theme’s .info in 2 groups; those loading pre-body and those loading post file like this:
; Scripts in head group to load pre-body
scripts[head][] = js/cufon.js
scripts[head][] = js/font.js
; Scripts in end group to load after all other html
scripts[end][] = js/scripts.js
Is there any way to print these out separately in my view? I assumed I would be abble to do it like this:
<?php print $scripts['head']; ?>
<!-- html -->
<?php print $scripts['end']; ?>
Thanks
As far as I can tell what I was trying to do is not possible but it can be done another way.
Create a [theme]_preprocess_html function in your template.php and use drupal_add_js to add your scripts with a scope then use drupal_get_js to retrieve all scripts added to each scope and as to $vars:
Documentation:
drupal_add_js
drupal_get_js