Same blueprint section saves different content?

Hi all!

Seems I hit a wall here.

I built aupon the portfolio example blueprint. The cover image is to be defined in the sidebar. the blueprint goes like this:

sidebar:
  cover:
    type: files
    label: Cover
    layout: cards
    image:
      cover: true
    info: "{{ file.dimensions }}"
    template: cover
    min: 1
    max: 3

this outputs an extra (filename).jpg.txt file with this content:

Sort: 1

----

Uuid: q5xuCHpeC5UoTXB6

----

Template: cover

If i put the very same blueprint into a column like this

columns:
      - width: 1/3
          headline:
            type: text
            placeholder: "{{ page.title }}"
            disabled: true
          cover:
            type: files
            label: Cover
            layout: cards
            image:
              cover: true
            info: "{{ file.dimensions }}"
            template: cover
            multiple: false

it just saves the Uuid to the (filename).jpg.txt.

Anyone knows why that is?

Hm, your examples look a bit incomplete. I might be mistaken, but the first example seems to be a files section? Whereas the second example seems to be a files field. A files field doesn’t have a template option, to assign a template to a files field you would have to use the uploads option.

ah okay that might be the problem. but how am i suppose to use it when not having a sidebar then?

If I understand you correctly, what you want in your column is the headline field plus a pages section, then, not a pages field?

If you want to mix sections and fields, your fields need to be wrapped inside a section (fields section in this case) as well:

columns:
  - width: 1/3
    sections: # different types of sections here
      fields: # a fields section
        type: fields
        fields:
          headline:
            type: text
            placeholder: "{{ page.title }}"
            disabled: true
      cover: # this is a section now as well
        type: files
        label: Cover
        layout: cards
        image:
          cover: true
        info: "{{ file.dimensions }}"
        template: cover
        multiple: false

I assume the sidebar example above was from a blueprint with a page preset?

ahh yes it has a page preset.

Thank you for your code example it helped a lot. I’d have to do some reading on why there’s no template option for fields but for sections…

As I wrote above, if you use a files field, you can also assign a template to files you upload via the field via the uploads option:

fields:
  cover:
    type: field
    uploads:
      template: cover