Jump to:

3392 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » Requirements not loading at all

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

Page: 1
Go to End
Author Topic: 1032 Views
  • Punch Rockgroin
    Avatar
    Community Member
    8 Posts

    Requirements not loading at all Link to this post

    Hi... I've run into a situation that I've never had on any other Silverstripe site - I can't get Requirements to load at all:

    In my mysite/code/Page.php

    class Page_Controller extends ContentController {
       
       public function init() {
          parent::init();
    Requirements::javascript("themes/RAC/js/customJquery.js");

       }
    }

    Doesn't load anything - so I figured it might be something I'm doing so i changed

    Requirements::javascript("themes/RAC/js/customJquery.js");

    to

    Requirements::customScript(<<<JS
    alert("hi there");
    JS
    );

    just to see but no custom scripts or css is loading at all -

    I'm going to try reinstalling the core just incase something got borked there but any ideas?

    Dave

    EDIT:

    Hmm... Nothing on the reinstall but I added Requirements::set_write_js_to_body(false); to _config and now it works. It shouldn't do that though right? As well, CustomCSS doesn't work either so something is certainly off.

  • reececropley
    Avatar
    Community Member
    11 Posts

    Re: Requirements not loading at all Link to this post

    Hello Punch Rockgroin,

    Im having the exact same problem but only one some pages.

    Will adding Requirements::set_write_js_to_body(false); to the config file break the pages that are working?

    TIA

    Reece

    1032 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.