Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Where to put requirements for CMS

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1235 Views
  • xmedeko
    Avatar
    Community Member
    94 Posts

    Where to put requirements for CMS Link to this post

    Hi,

    I am extending a functionality of CMS and I need to add my javascript and CSS. I use:

    Requirements::css(project()."/css/XELayoutEditor.css");
    Requirements::javascript(project()."/javascript/XELayoutEditor.js");

    When I put it into getCMSFields(), or Controller::init(), or wherever else inside my class, then they are not loaded by default. I have to click on my page, then reload CMS. I can put Requirements to _config.php, but then they will be loaded even when the user will be browsing the final pages. I want to load them only when the admin CMS is open.

    Is the only proper place CMSMain::init()?

    cheers
    andrew

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Where to put requirements for CMS Link to this post

    There's a limitation with the system, and you have to add them in CMSMain as you said.

    Cheers,
    Sean

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