Hi all,
in a K3.5 i would like to query the data for a select-field from a global structure-field and set the default by the first element of that structure. Unfortenetly that doesn’t work like i want. I would be really happy, if someone can help me here :*
i have a global teaser structure in site.yml
teasers:
label: Global Teasers
type: structure
fields:
id:
label: ID
type: text
required: true
teaserh2:
label: Headline
type: text
required: true
...
and a selectfield in page-xy.yml, fetching the structure
teaser:
label: Select from global Teasers
type: select
options: query
query:
fetch: site.teasers.toStructure
text: "{{ structureItem.id }}"
value: "{{ structureItem.id }}"
default: About
# default: site.teasers.toStructure.first.id
Unfortenetly i am not able to set the default-value by the id of the first element in the structure.
I have tried several formats. If i hardcode the id, it works - but i need always the first item to be the default.
A second question:
I would like to set text and value of the selectfield-data to lowercase.
Unfortenetly that won’t work also.
teaser:
label: Select from global Teasers
type: select
options: query
query:
fetch: site.teasers.toStructure
text: "{{ structureItem.id.lower }}"
value: "{{ structureItem.id.lower }}"
All i get then is that:
What am i doing wrong here?
Thx!