Hi there,
I have a select field in my blueprint, where I retrieve the available options by the query field:
signature:
type: select
label: Signature
empty: false
required: true
options: query
query: "site.find('signatures').children().sortBy('title', 'desc')"
The objective is to select a page, which contains the signature. By default the newest one should be selected, when creating new pages.
So I want to have the first field in the queried collection to be the default value for this field and tried various approaches:
default: "{{ site.find('signatures').children().sortBy('title', 'desc').first }}"
default: "{{ site.find('signatures').children().sortBy('title', 'desc').first.id }}"
default: "{{ site.find('signatures').children().sortBy('title', 'desc').first.uri }}"
default: "signatures/{{ site.find('signatures').children().sortBy('title', 'desc').uid }}"
But non of them worked as expected and I cannot really find an example or possible solutions in the docs. I hope somebody can help me. I’ve put these codes in the help field to see the output, where it gave me the correct value. I do not know, if I am doing something wrong or this is simply not intended to work as I thought.
I am using Kirby v3.
Just let me know, if you need any further information.
Best wishes,
Chris