]> git.parisson.com Git - mezzo.git/commitdiff
Fix page_card images
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Aug 2016 16:03:49 +0000 (18:03 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 25 Aug 2016 16:03:49 +0000 (18:03 +0200)
app/templates/pages/includes/page_card.html

index 2e911a9332888469e2186fab91ff5066b371120c..39f4cdf68a2117ca7ecb7e8622a617a1d3b1cd6f 100644 (file)
@@ -1,8 +1,10 @@
 {% load mezzanine_tags organization_tags %}
 <a href="{{ object.get_absolute_url }}" title="{{ object.title }}" class="page-box">
     <div class="page-box__image">
-      {% with object.get_content_model.images.all|get_type:'card' as image %}
-        <img src="{{ MEDIA_URL }}{% thumbnail image.file 900 400 %}" />
+      {% with object.get_content_model.images.all|get_type:'card' as images %}
+       {% if images %}
+        <img src="{{ MEDIA_URL }}{% thumbnail images.0.file 900 400 %}" />
+       {% endif %}
       {% endwith %}
     </div>
     <div class="page-box__content">