# Blueprint: Query fields from multiple pages?

**URL:** <https://forum.getkirby.com/t/blueprint-query-fields-from-multiple-pages/29736>\
**Category:** Questions\
**Tags:** v3\
**Created:** [October 12, 2023, 11:30am UTC](https://forum.getkirby.com/t/blueprint-query-fields-from-multiple-pages/29736 "2023-10-12T11:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weltverloren](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/weltverloren/32/13826_2.png) [@Weltverloren](https://forum.getkirby.com/u/Weltverloren)\
**Post date:** [October 12, 2023, 11:30am UTC](https://forum.getkirby.com/t/blueprint-query-fields-from-multiple-pages/29736/1 "2023-10-12T11:30:23Z")

</div>

Hey there!

I would like to feed a “tags” field with content from all the instances of a particular “structure” field across multiple pages of the same template:

> site.children.filterBy(“intendedTemplate”, “category”).items.toStructure

This won’t work, as it looks like the query can only process the field contents of a single page.

Is there a solution for this, or will I just have to structure my content differently to avoid this requirement?

Thanks a bunch! : )

---

<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:** [October 12, 2023, 11:32am UTC](https://forum.getkirby.com/t/blueprint-query-fields-from-multiple-pages/29736/2 "2023-10-12T11:32:49Z")

</div>

You need a custom page method for this, that collects all the tags of all the pages structure fields into a single tags array.

---

<div class="post-metadata">

**Author:** ![Weltverloren](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/weltverloren/32/13826_2.png) [@Weltverloren](https://forum.getkirby.com/u/Weltverloren)\
**Post date:** [October 12, 2023, 12:19pm UTC](https://forum.getkirby.com/t/blueprint-query-fields-from-multiple-pages/29736/3 "2023-10-12T12:19:18Z")

</div>

Alright, thanks for pointing me in the right direction (and for replying as quickly as always). : )

```auto
Kirby::plugin('my/site-methods', [
    'siteMethods' => [
        "getItems" => function () {
            $categories = $this->children()->filterBy("intendedTemplate", "category");
            $items = new Structure();
            foreach ($categories as $category) {
                //Merge and prep structure fields according to requirement.
            }
            return $items;
        }
    ]
]);

```
