Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Requirements::customCSS is not working at all for me

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

Page: 1
Go to End
Author Topic: 1451 Views
  • quamsta
    Avatar
    Community Member
    29 Posts

    Requirements::customCSS is not working at all for me Link to this post

    I need to access the database in order to pull a CSS background image on a page in my site. I decided to use an inline style to access this background image.

    However whenever I place this in my code, using the documentation as a template for the heredoc format:

    function init() {
       parent::init();
       Requirements::themedCSS("HomePage");
       Requirements::customCSS(<<<CSS
       #minisite-header {
          background: url($ContentImage.URL) no-repeat;
       
       }

    CSS
    );
    }

    }

    I get a blank PHP screen (which looks like a parse error, maybe, but I can't turn on verbose error reporting in PHP)

    So thinking that I messed up the heredoc format somewhere, I try just this simple function:

    Requirements::customCSS("test");

    And I still get nothing.

    The similar function:

    Requirements::customScript("test");

    Works fine. What's going on?

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Requirements::customCSS is not working at all for me Link to this post

    Duh, fixed in http://open.silverstripe.com/changeset/71467 ;) Thanks for noticing...

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