Image Path for Background Image

Since static is copied over as-is, you could set this to the root, but I wouldn’t recommend it:

<div style="background-image:url(/images/placeholder.jpg')"></div>

You’re better off future-proofing it a bit and making it relative using a func in your templates…

<div style="background-image:url('{{"/images/placeholder.jpg" | relURL }}')"></div>

Further, I’m guessing you are going to define a variable in a page to pass in a different image for placeholder, yeah? You can use the default function to set a default/placeholder value…

HTH

4 Likes