# Query options from other blueprint

**URL:** <https://forum.getkirby.com/t/query-options-from-other-blueprint/24051>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 25, 2021, 5:43am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051 "2021-11-25T05:43:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![grindstaff](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@grindstaff](https://forum.getkirby.com/u/grindstaff)\
**Post date:** [November 25, 2021, 5:43am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/1 "2021-11-25T05:43:59Z")

</div>

Hi - I’m using the Color Palette plugin:

> **[GitHub - sylvainjule/kirby-color-palette: A color palette to pick colors from...](https://github.com/sylvainjule/kirby-color-palette)**
>
> A color palette to pick colors from in the panel. Kirby 3 only. - GitHub - sylvainjule/kirby-color-palette: A color palette to pick colors from in the panel. Kirby 3 only.

…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:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/6bf836780f2453c406723489c2b82070f5c1cbd3.jpeg)

And am trying to query this from another template:  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/9/9dedece49fc090f863e105b9797068e3986ad727.png)

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

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 25, 2021, 7:25am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/2 "2021-11-25T07:25:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![grindstaff](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@grindstaff](https://forum.getkirby.com/u/grindstaff)\
**Post date:** [November 25, 2021, 8:06am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/3 "2021-11-25T08:06:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [November 25, 2021, 8:16am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/4 "2021-11-25T08:16:35Z")

</div>

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.

> **[Using blueprints in the frontend](https://getkirby.com/docs/cookbook/templating/blueprints-in-frontend)**
>
> Access blueprints and use this data to control your logic.

---

<div class="post-metadata">

**Author:** ![grindstaff](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@grindstaff](https://forum.getkirby.com/u/grindstaff)\
**Post date:** [November 25, 2021, 8:24am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/5 "2021-11-25T08:24:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [November 25, 2021, 8:32am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/6 "2021-11-25T08:32:29Z")

</div>

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

```auto
fetch: site.getColorOptions

```

> **[Site methods](https://getkirby.com/docs/reference/plugins/extensions/site-methods)**

---

<div class="post-metadata">

**Author:** ![grindstaff](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@grindstaff](https://forum.getkirby.com/u/grindstaff)\
**Post date:** [November 25, 2021, 8:47am UTC](https://forum.getkirby.com/t/query-options-from-other-blueprint/24051/7 "2021-11-25T08:47:20Z")

</div>

I see… thanks again for your help.
