- {% set files = page.files.sortBy('sort') %}
- {% for file in files %}
- {% if file.type == 'image' %}
-
-
- {{ file.caption }}
-
- {% elseif file.type == 'video' %}
- {% endif %}
+ {% if page.files.isNotEmpty %}
+ {% set artworks = page.files.sortBy('sort') %}
+ {% for artwork in artworks %}
+
+ {% if artwork.type == 'video' %}
+
+ {% endif %}
+ {% if artwork.type == 'image' %}
+
+ {% endif %}
+ {% if artwork.caption %}
+ {{ artwork.caption }}
+ {% endif %}
+
{% endfor %}
-
+ {% endif %}