Hi all - I’m having trouble reference data from a structured field via query language that I was hoping for some help with.
In my site blueprint I am defining a series of colours:
colours:
label: colours
type: structure
fields:
swatch:
label: Colour code
type: color
colourName:
label: Colour name
type: text
And in my page blueprint I am able to query these structured items so that they can selected:
projectColour:
label: Project Colour
type: select
width: 1/2
options:
type: query
query: site.colours.toStructure
text: "{{ item.colourName }}"
value: "{{ item.swatch }}"
But doing this only records what I set as the value (so in this case ‘item.swatch’) in the page content file. I’m stumped at how to record both values (‘colourName’ as well as ‘swatch’) from the structured field as separate variables that I can display in the template.
Currently I can only use ‘<?=$page->projectColour() ?>’ to retrieve just the one value.
Thanks!