0
votes
{% 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?

1
Can you show us Photo model too?Hisham___Pak

1 Answers

1
votes

Simply try:

<div class='image-block col-sm-4' style="background: url("{{photo}}") no-repeat center top;background-size:cover;"></div>