I have a problem fetching a list of people in a select field in my blueprint.
It seems to me to have tried everything but I can’t make it work. What am I doing wrong?
I have a page with template “people” (direct child of site) where I put all the people’s informations.
Now I need to fetch the people list in another page.
Below the two blueprints interested parts:
template people
title: Persone
icon: users
options:
delete: false
status: false
pages: false
columns:
left:
width: 3/4
sections:
content:
type: fields
fields:
people:
label: Lista delle persone
type: structure
fields:
name:
label: Nome
type: text
required: true
width: 1/2
lastName:
label: Cognome
type: text
required: true
width: 1/2
template class
title: Corso
icon: calendar
fields:
description:
label: Descrizione del corso
type: markdown
size: small
appointments:
label: Prossimi appuntamenti
type: structure
fields:
classDateBegins:
label: Data di inizio corso
type: date
default: now
width: 1/2
classDateEnds:
label: Data di fine corso
type: date
width: 1/2
help: Se il campo viene lasciato vuoto il corso avrà la durata di un solo giorno
classTeacher:
label: Insegnante
type: select
options: query
query:
fetch: site.children.template("people").people.toStructure
text: "{{ structureItem.name }}"
Oh shit, I was absolutely sure that I had to call the template name, not the actual page name.
How stupid… I lost an hour trying to make this work. I guess I’m not going to do the same mistake again!
Thank you so so so much for your help and your time.
Of course it works perfectly now.
Yeah, it is maybe better if I use the second option, the one with the template.
This way if the client decides to change the url of the page everything will still work.
On an events page (events.yml) there are subpages (single events) and there is a structure for different event-sections. I want to query the structure items from the single event page (event.yml) in a select field, so one can select an event-section for a single event.