Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Javascript location


Reply


3 Posts   1046 Views

Avatar
Mo

Community Member, 510 Posts

18 March 2009 at 3:37am

Hi all,

Just started working with SIlverStripe and am quite impressed so far. Great job all of you! :)

I had a quick question (I am sure on of many), is it possible to change the location that the Requirements class places JavaScript files? I am loading jQuery and the jQuery corners plugin, but currently it is placing the <script> tags just before the </body> tag.

It would be nice if I could move them to be rendered inside the <head> tags instead. Is this do-able?

Many thanks,

Mo

Avatar
Invader_Zim

Community Member, 141 Posts

19 March 2009 at 12:42am

Edited: 19/03/2009 12:42am

Hi.

You can disable writing all javascripts to the body and include them in the head by setting this in your mysite/_config file :

Requirements::set_write_js_to_body(false);

Cheers,
Christian

Avatar
Mo

Community Member, 510 Posts

19 March 2009 at 1:34am

That is ACE! Thanks ever so much :).