# Query language — menu builder

**URL:** <https://forum.getkirby.com/t/query-language-menu-builder/30752>\
**Category:** Questions\
**Tags:** v4\
**Created:** [February 10, 2024, 11:38am UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752 "2024-02-10T11:38:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrntmszrs](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lrntmszrs/32/8310_2.png) [@lrntmszrs](https://forum.getkirby.com/u/lrntmszrs)\
**Post date:** [February 10, 2024, 11:38am UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/1 "2024-02-10T11:38:19Z")

</div>

Hi everyone,

For a _menu builder_ I want to restrict the choices of the sub pages, to the children of the first level pages chosen in the same structured item.

```auto
mainmenu:
    label: Menu
    type: structure
    fields:
        firstlevelpage:
            label: First level
            type: pages
            max: 1
        subpagesselector:
                label: Second level pages… children of the first level
                type: pages
                query: ???

```

Thanks.

Laurent

---

<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:** [February 10, 2024, 11:50am UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/2 "2024-02-10T11:50:16Z")

</div>

That is not possible without a custom implementation.

---

<div class="post-metadata">

**Author:** ![lrntmszrs](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lrntmszrs/32/8310_2.png) [@lrntmszrs](https://forum.getkirby.com/u/lrntmszrs)\
**Post date:** [February 10, 2024, 1:03pm UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/3 "2024-02-10T13:03:51Z")

</div>

Thanks for your swift answer.

> [@texnixe](#):
>
> not possible without a custom implementation

At which level, if I may ?

---

<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:** [February 10, 2024, 1:26pm UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/4 "2024-02-10T13:26:25Z")

</div>

> [@lrntmszrs](#):
>
> At which level, if I may ?

What do you mean?

---

<div class="post-metadata">

**Author:** ![lrntmszrs](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lrntmszrs/32/8310_2.png) [@lrntmszrs](https://forum.getkirby.com/u/lrntmszrs)\
**Post date:** [February 10, 2024, 1:39pm UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/5 "2024-02-10T13:39:42Z")

</div>

Sorry…

I mean at wich level should it be a custom implementation ?  
Should I investigate towards the Kirby Query Language (KQL) plugin ?

L

---

<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:** [February 10, 2024, 1:44pm UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/6 "2024-02-10T13:44:28Z")

</div>

> [@lrntmszrs](#):
>
> Should I investigate towards the Kirby Query Language (KQL) plugin ?

No, KQL is for querying data from your Kirby installation via API.

Here, you want one field inside a structure to listen to changes in another field inside the structure and then filter the list of options for this second field.

So in my opinion, you probably need a custom field consisting of two subfields, where one subfield listens to the other and then makes a query to the backend to get a list of results. Or maybe a single field is enough, no sure.

---

<div class="post-metadata">

**Author:** ![lrntmszrs](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lrntmszrs/32/8310_2.png) [@lrntmszrs](https://forum.getkirby.com/u/lrntmszrs)\
**Post date:** [February 10, 2024, 2:25pm UTC](https://forum.getkirby.com/t/query-language-menu-builder/30752/7 "2024-02-10T14:25:37Z")

</div>

Thanks for the tips. I’ll investigate in that direction.

L
