I have entries that contain a single graphic asset. I'm trying to use the graphic as a background image in my template. However, I'm unable to output the URI for the asset. I'm using entry.graphic.first().url but I get an error that the property is null. I'm using the dbug plugin to look at the properties and can see that the asset is being returned, however the URI property is null.

I am looping through entries and am unable to return the URI for any of the graphics. Any ideas?


EDIT: Sorry for the lack of code, guys! Below is my whole content block for the page so far.

<div class="container archive">
  <h1>Video Archives</h1>

  {% for entry in craft.entries.section('watch').order('seriesStart desc').type('series') %}
    {% set thumb = entry.graphic.first() %}
    <div class="col-md-3 seriesthumb" style="background-image: url('{{thumb.url}}');"></div>
  {% endfor %}


Thanks for the help!

  • I've noticed that if I try and pull the graphic's URI outside of the loop, I'm able to return it. It's when it's in the loop that I can't get the URI.
    – anguiac7
    Commented Apr 23, 2015 at 2:01
  • What loop? Are you overwriting entry with that?
    – carlcs
    Commented Apr 23, 2015 at 5:45
  • Hi anguiac! Can you please edit your question to include a larger code sample? What you've provided so far isn't enough to determine what may be the problem.
    – Lindsey D
    Commented Apr 23, 2015 at 6:02
  • After {% set thumb = entry.graphic.first() %}, if you {{ thumb | dbug }}, is it the image you're expecting?
    – Brad Bell
    Commented Apr 23, 2015 at 16:52
  • @BradBell yes, I see the properties for the image, but the URI property is NULL. I've re-uploaded and cleared the asset cache but nothing helped.
    – anguiac7
    Commented Apr 23, 2015 at 23:09

1 Answer 1


Through Pixel and Tonic's support email, I figured out what the issue was. It turns out one of my entries didn't have a thumbnail and that was why the image was null. Stupid user error! I thought I had checked to make sure everything was good but I guess not. Thanks for the help @BradBell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.