I have declared following custom field in themes blueprint:
header.object_photos:
name: photos
type: list
label: Photos
fields:
.custom_file:
type: file
label: Photo
multiple: false
destination: 'self@'
random_name: false
avoid_overwriting: false
filesize: 50
accept:
- image/*
.description:
type: text
label: Description
And I’m trying to loop trough that list, to display image and description in my template. Description works nicely, but I’m havind trouble with image:
{% if page.header.object_photos %}
{% for image in page.header.object_photos %}
{{ image.custom_file.cropResize(500, 70).html() }}
{{ image.description }}
{% endfor %}
{% endif %}
When I look at my page’s markdown file, then there I have picture files path.
object_photos:
-
description: Test1
custom_file:
user/pages/01.Kodu/korterelamu-roosikrantsi-8b/roosikrantsi.jpg:
name: roosikrantsi.jpg
type: image/jpeg
size: 2467042
path: user/pages/01.Kodu/korterelamu-roosikrantsi-8b/roosikrantsi.jpg
---