# Blueprint query

**URL:** <https://forum.getkirby.com/t/blueprint-query/24476>\
**Category:** Questions\
**Tags:** v3\
**Created:** [January 14, 2022, 5:06pm UTC](https://forum.getkirby.com/t/blueprint-query/24476 "2022-01-14T17:06:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 14, 2022, 5:06pm UTC](https://forum.getkirby.com/t/blueprint-query/24476/1 "2022-01-14T17:06:34Z")

</div>

Hi there,

Every event has a field “registrations” (type: users).  
These users have accounts in the panel (with blueprint “user.yml”).  
Everyone that signs up to that event, gets added to that “registrations” field.

Is there a way to show the user’s events on it’s page in the panel?  
In case of “Jose”, the event “Plog de Gent Trailrun” should show up in the “events” field…

See screenshots:

 ![Screenshot 2022-01-14 at 18.02.28](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/cbef2dc048722049bf351f50a119908293d317d2.jpeg)

 ![Screenshot 2022-01-14 at 18.02.04](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/c7aca937243290ebd5f2be0bbc7a5d57ff903c68.png)

 ![Screenshot 2022-01-14 at 18.06.05](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/2/21cf844ce4ca331e81d1f024acaabe4194819541.png)

---

<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:** [January 14, 2022, 5:30pm UTC](https://forum.getkirby.com/t/blueprint-query/24476/2 "2022-01-14T17:30:16Z")

</div>

> [@jarneuyt](#):
>
> Is there a way to show the user’s events on it’s page in the panel?

For your example you are using a pages field, but that is a select field and doesn’t magically list all available pages.

A standard Kirby pages section, on the other hand, cannot be filtered.

But @rasteiner’s Pagesdisplaysection plugin to the rescue:

> **[GitHub - rasteiner/k3-pagesdisplay-section: K3 plugin: display any page list...](https://github.com/rasteiner/k3-pagesdisplay-section)**
>
> K3 plugin: display any page list in a section. Any parent, many parents, filtered, don't care. - GitHub - rasteiner/k3-pagesdisplay-section: K3 plugin: display any page list in a section. An...

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 15, 2022, 8:44am UTC](https://forum.getkirby.com/t/blueprint-query/24476/3 "2022-01-15T08:44:51Z")

</div>

Maybe a bit of a workaround, but could I use a select field instead with an advanced query? To see all the events that specific user goes to, will be listed in that select.

---

<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:** [January 15, 2022, 8:51am UTC](https://forum.getkirby.com/t/blueprint-query/24476/4 "2022-01-15T08:51:19Z")

</div>

The select field works in the same way as the pages field: you have to explicitly select something, which is not what you are after, I assume, since you want to display the pages assigned to a given user.

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 15, 2022, 9:01am UTC](https://forum.getkirby.com/t/blueprint-query/24476/5 "2022-01-15T09:01:00Z")

</div>

True, thanks for your quick help!  
Maybe this is something interesting to add to Kirby?

Some “read only” fields where you can show relations…

---

<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:** [January 15, 2022, 9:06am UTC](https://forum.getkirby.com/t/blueprint-query/24476/6 "2022-01-15T09:06:00Z")

</div>

> [@jarneuyt](#):
>
> Some “read only” fields where you can show relations…

I think a section is the better fit for this purpose and the pagesdisplay section is exactly what you need. But yes, if it was built-in, that would even be better:

[https:feedback.getkirby.com](https://https:feedback.getkirby.com)

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 15, 2022, 9:38am UTC](https://forum.getkirby.com/t/blueprint-query/24476/7 "2022-01-15T09:38:01Z")

</div>

@texnixe  
Im trying to make it work but I get this error. Any idea what’s wrong?

 ![Screenshot 2022-01-15 at 10.36.27](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/e/eafeaf75f40418e8ba91be0122b64311bf1d89fd.png)

 ![Screenshot 2022-01-15 at 10.37.35](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/f/f67e8adeaef65bd7eaca0dc3c8e476f89a9e34c4.png)

---

<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:** [January 15, 2022, 10:18am UTC](https://forum.getkirby.com/t/blueprint-query/24476/8 "2022-01-15T10:18:56Z")

</div>

Looks like you also have to set the parent prop, don’t know if this is because we are not in the site/page context here:

```auto
      mysection:
        headline: Some headline
        type: pagesdisplay
        parent: kirby.site
        query: kirby.site.index.filterBy('template', 'note')

```

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 15, 2022, 10:25am UTC](https://forum.getkirby.com/t/blueprint-query/24476/9 "2022-01-15T10:25:21Z")

</div>

> [@texnixe](#):
>
> `parent: kirby.site`

Thank you, it works now! Brilliant 🙂

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 15, 2022, 10:36am UTC](https://forum.getkirby.com/t/blueprint-query/24476/10 "2022-01-15T10:36:09Z")

</div>

Almost there, this is my query:  
**query: site.find(“challenges”).children.published.filterBy(‘registrations’, ‘\*=’, ‘U44BRSiT’)**

Instead of hardcoded user ID “U44BRSiT”, how do I make the user ID (the current user page I’m on) dynamic?

---

<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:** [January 15, 2022, 4:02pm UTC](https://forum.getkirby.com/t/blueprint-query/24476/11 "2022-01-15T16:02:33Z")

</div>

Doesn’t `user.id` work?

---

<div class="post-metadata">

**Author:** ![jarneuyt](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jarneuyt/32/9504_2.png) [@jarneuyt](https://forum.getkirby.com/u/jarneuyt)\
**Post date:** [January 17, 2022, 8:49am UTC](https://forum.getkirby.com/t/blueprint-query/24476/12 "2022-01-17T08:49:58Z")

</div>

`page.id` did the trick
