Query options from other blueprint

Hi - I’m using the Color Palette plugin:

…and was hoping to use the query function to pull from a pre-defined set of colors, so that if I need to change out color options I can do this once instead of across several blueprints in the site.

Right now I have this entry in the site.yml blueprint:

And am trying to query this from another template:

…but am getting an error (Invalid query result data)
Does anyone know what the correct syntax to use here would be?
Thank you!!

What exactly do you want to get here? All the options or the ones selected by the user? I guess the selected values are stored as comma separated list? Or in yaml format in site.txt?

Sorry - The colors aren’t user-editable, they’re just listed in the site.txt blueprint & I’d like to make those same colors available in other blueprints without repeating them each time, if that makes sense. Thank you again!

In that case you actually have to go via the $page->blueprint() method to fetch those options. I’d create a custom page method that returns an array of options from that field, see this recipe for more details.

Hmmm - will this method work inside of a blueprint? I’m not trying to access them from the front end…

That’s why I said you better create a custom site method in which you access the blueprint method.

e.g. custom method getColorOptions(), which you can then query

fetch: site.getColorOptions

I see… thanks again for your help.