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.

Template Questions

Parsing a CSS/PHP file - possible?


2 Posts   352 Views


22 April 2014 at 6:45am Community Member, 5 Posts

I'd like to parse a single CSS file in the context of the page I'm viewing, so I can set background images to the url's of files that the client has uploaded. Would something like this be possible within Silverstripe?

.hero {
background-image: url('{$HeroImage.URL}') no-repeat;


22 April 2014 at 9:49am Forum Moderator, 149 Posts

You can use customCSS requirements in your Page_Contoller init() method. See