Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 302762

No way to place js at the top of page['page_bottom'] using hook_js_alter in template.php if hook_page_alter was used in module

$
0
0

1. some Drupal modules use hook_page_alter to add js to the $page['page_bottom'] region.

$page_bottom and $page['page_bottom'] are explained here: http://drupal.org/update/modules/6/7#hook_footer

2. I now want to change the scope of other js to be at the bottom of the page but at the top of $page['page_bottom'] so as to come before the inline js injected in 1.

I can't seem to do it.

in hook_js_alter, scope can be header, footer. $page_bottom, $page, $page['page_bottom'] are not available to hook_js_alter.

in hook_js_alter:

$script['scope'] = 'footer'; works
but
$script['scope'] = $page_bottom; does not.

While group and weight work within hook_js_alter, they can't be used to alter the position vs. js added using hook_page_alter.


Viewing all articles
Browse latest Browse all 302762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>