Reputation: 127
{% if photos %} {% for photo in photos %} {% endfor %} {% else %} No images availble for the project. {% endif %}
And I want to add a picture url inside the style tag.
div class='image-block col-sm-4' style="background: url({{photo}}) no-repeat center top;background- size:cover;"
How can I get the {{photo}} url inside the string?
Upvotes: 0
Views: 76
Reputation: 4095
Simply try:
<div class='image-block col-sm-4' style="background: url("{{photo}}") no-repeat center top;background-size:cover;"></div>
Upvotes: 1