# Blueprint: select uid children pages

**URL:** <https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949>\
**Category:** Questions\
**Tags:** v2\
**Created:** [August 11, 2016, 5:42pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949 "2016-08-11T17:42:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Perry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/perry/32/1336_2.png) [@Perry](https://forum.getkirby.com/u/Perry)\
**Post date:** [August 11, 2016, 5:42pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/1 "2016-08-11T17:42:31Z")

</div>

Hello,

how can I add a select field into the my blueprint  
to select the uid of a children page from the current page ?

```
 submenu-target:
    label: Submenu target
    type: select 
    options: query
    query:
      page: 
      value: '{{uid}}'

```

---

<div class="post-metadata">

**Author:** ![Thiousi](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thiousi/32/13656_2.png) [@Thiousi](https://forum.getkirby.com/u/Thiousi)\
**Post date:** [August 11, 2016, 5:44pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/2 "2016-08-11T17:44:58Z")

</div>

From the docs:

> Any page URI. This is a powerful way to fetch any kind of data from any other page. You can even use relative paths to step up levels in the hirarchy. For example: …/…/ to go two levels up or / to get to the top level.

This means you should be able to just put the id of the page without any ‘/’ before

---

<div class="post-metadata">

**Author:** ![jevets](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jevets/32/978_2.png) [@jevets](https://forum.getkirby.com/u/jevets)\
**Post date:** [August 11, 2016, 5:46pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/3 "2016-08-11T17:46:57Z")

</div>

Does this not work for you?

```auto
 submenu-target:
    label: Submenu target
    type: select 
    options: children

```

---

<div class="post-metadata">

**Author:** ![jevets](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jevets/32/978_2.png) [@jevets](https://forum.getkirby.com/u/jevets)\
**Post date:** [August 11, 2016, 5:51pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/4 "2016-08-11T17:51:16Z")

</div>

Also, you shouldn’t use hyphens in field names. Use underscores or camelCase instead, see docs here [https://getkirby.com/docs/panel/blueprints/form-fields#field-names](https://getkirby.com/docs/panel/blueprints/form-fields#field-names)

```auto
 submenu_target:
    label: Submenu target
    type: select 
    options: children

```

or

```auto
 submenuTarget:
    label: Submenu target
    type: select 
    options: children

```

---

<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:** [August 11, 2016, 5:52pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/5 "2016-08-11T17:52:02Z")

</div>

If you want to use the query option, it should lool like this:

```auto
options: query
query:
  fetch: children
  value: '{{uid}}'

```

The `uid` is default for value anyway, so you may omit that.

If you are not using anything else than default options, you might as well use the short form as proposed by @jevets

---

<div class="post-metadata">

**Author:** ![Perry](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/perry/32/1336_2.png) [@Perry](https://forum.getkirby.com/u/Perry)\
**Post date:** [August 11, 2016, 8:11pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/6 "2016-08-11T20:11:58Z")

</div>

thanks @all for the super fast answers

**Navigation**  
if the mother have child and have no content you have the choice  
which child is linked with the mother.

```
 if($item->submenu_target() != '')
              {
              	echo $item->url().'/'.$item->submenu_target();
              }
              else
              {
              	echo $item->children()->first()->url();}
              }
```

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:57pm UTC](https://forum.getkirby.com/t/blueprint-select-uid-children-pages/4949/7 "2025-02-06T16:57:21Z")

</div>

Archived on February 6, 2025, 4:57pm UTC


