# Blueprint - Query other pages using current page uid

**URL:** <https://forum.getkirby.com/t/blueprint-query-other-pages-using-current-page-uid/22895>\
**Category:** Questions\
**Tags:** v3\
**Created:** [July 15, 2021, 11:30am UTC](https://forum.getkirby.com/t/blueprint-query-other-pages-using-current-page-uid/22895 "2021-07-15T11:30:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ostrogo](https://avatars.discourse-cdn.com/v4/letter/o/a5b964/32.png) [@Ostrogo](https://forum.getkirby.com/u/Ostrogo)\
**Post date:** [July 15, 2021, 11:30am UTC](https://forum.getkirby.com/t/blueprint-query-other-pages-using-current-page-uid/22895/1 "2021-07-15T11:30:32Z")

</div>

Hi there,

I’m pretty new at Kirby but having a lot of fun playing with it. Really nice coding philosophy but it sometimes a bit hard to find the appropriate documentation 🙂

I have two pages type : News and Artists. I would select in my _Artist_ blueprint the _News_ pages wich contains the _artist_ field with the current uid.

I did that :

```auto
  news:
                name: News 2
                fields:
                  article:
                    type: pages
                    info: "{{ page.date.toDate('d.m.Y') }}"
                    query: site.children.template('news').filterBy('artist', {{ uid }})

```

What should be the right syntax ?

Thanks a lot and have a good day !

---

<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:** [July 15, 2021, 9:03pm UTC](https://forum.getkirby.com/t/blueprint-query-other-pages-using-current-page-uid/22895/2 "2021-07-15T21:03:03Z")

</div>

Has this been solved by the answer on Discord? Please try not to double post (and least not without reference to the original topic).

---

<div class="post-metadata">

**Author:** ![Ostrogo](https://avatars.discourse-cdn.com/v4/letter/o/a5b964/32.png) [@Ostrogo](https://forum.getkirby.com/u/Ostrogo)\
**Post date:** [July 16, 2021, 2:34pm UTC](https://forum.getkirby.com/t/blueprint-query-other-pages-using-current-page-uid/22895/3 "2021-07-16T14:34:40Z")

</div>

Hi,

thanks that was a good advice, and found a way to solve my problem. Here is what I did :

```auto
Kirby::plugin('my/page-methods', [
    'pageMethods' => [
        'artistNews' => function ($site) {

            $news = $site->children()->template('news')->published();

            $selection = $news->filter(function ($child) {
              return $child
                     ->artist()
                     ->toPages()
                     ->filterBy('uid', $this->uid())
                     ->isNotEmpty();
            });

            return $selection;
        }
    ]
]);

```

It works perfectly.

Thanks for the help, and sorry for the doublon with Discord. I’ll watch this out in the future.
