File field frontmatter format

Hi! So I made a custom blueprint in admin.

title: Gallery
form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        gallery:
          type: tab
        
          fields:
            header.gallery:
              name: gallery
              type: list
              style: vertical
              label: Gallery list
              collapsed: true
              fields:
                .tittel:
                  type: text
                  label: Title
                .method:
                  type: text
                  label: Method
                .date:
                  type: datetime
                  label: Date
                .upload:
                  type: file
                  name: image
                  label: Choose image
                  destination: 'self@'

Frontmatter output:

title: Gallery
gallery:
    -
        title: Stikket
        method: 'Pencil drawing'
        upload:
            user/pages/01.gallery/Stikket.jpg:
                name: Stikket.jpg
                type: image/jpeg
                size: 256487
                path: user/pages/01.gallery/Stikket.jpg
    -
        title: 'Fra jorda'
        method: Sketch
        upload:
            user/pages/01.gallery/frajorda.jpg:
                name: frajorda.jpg
                type: image/jpeg
                size: 168208
                path: user/pages/01.gallery/frajorda.jpg

And this works greate! But, the output makes it so I can not access the image path to include in

{% for image in page.header.gallery %}
    <img src="{{ image.upload.path }}"></img>
{% endfor %}

because the frontmatter header under upload becomes a unique name:

user/pages/01.gallery/frajorda.jpg:

I search and found alot of the same and similar problems, but it still is not a solution for this problem.
If I have to add a meta file for each image it would have to be automatically created when the image is uploaded since this site is used by someone who needs it to be as simple as possible.

Thanks!

quick workaround, not tested

{% for image in page.header.gallery %}
  {% for thumb in image.upload %}
    <img src="{{ page.media[thumb.name].url }}"></img>
  {% endfor %}
{% endfor %}
1 Like

Works very well! Thank you!

If there is someone who knows how to change the file frontmatter header too that would be great, even if it does not matter in this project I am sure it matters in others.

Thanks:)