Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Javascript location

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 994 Views
  • Mo
    Avatar
    Community Member
    508 Posts

    Javascript location Link to this post

    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

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Javascript location Link to this post

    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

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Javascript location Link to this post

    That is ACE! Thanks ever so much .

    994 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.