# Page from Select Field

**URL:** <https://forum.getkirby.com/t/page-from-select-field/5750>\
**Category:** Questions\
**Tags:** v2\
**Created:** [November 13, 2016, 9:57am UTC](https://forum.getkirby.com/t/page-from-select-field/5750 "2016-11-13T09:57:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [November 13, 2016, 9:57am UTC](https://forum.getkirby.com/t/page-from-select-field/5750/1 "2016-11-13T09:57:39Z")

</div>

Looks like Saturdays and Sundays are the perfect time to spot problems in my Kirby sites 😅

I have structured field in my home.yml blueprint in which I have a select field that pulls all the pages with a project template.

Looks like this

```
slideproject:
    label : Projects
    type : select
    options: query
    query :
        fetch : pages
        template : project

```

The select works as expected and I can sepickect the projects I need to display without troubles.  
Now in my home.php template I do the following:

```
<?php
if ($slides = $page->slides()->toStructure()) :
    foreach ($slides as $slide) :
        
        $project = $slide->slideProject();

    endforeach
endif;
?>

```

Up until this point everything works correctly and I get the correct uri if I try to echo the $project variable.  
My problem is, no matter what I do, I can’t get the page object using the uri

None of these work

```
page($project)->title();
$project->toPage()->title();

```

The only option that seems to work is

```
$site->index()->findBy('uid' , $project)->title()

```

Is this normal or am I missing something?  
The site is multilang.

---

<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:** [November 13, 2016, 10:32am UTC](https://forum.getkirby.com/t/page-from-select-field/5750/2 "2016-11-13T10:32:13Z")

</div>

If you change your blueprint like this, i.e. using the value option

```auto
slides:
    label : Projects
    type : select
    options: query
    query:
      fetch: pages
      template : project
      value: '{{uri}}'

```

the URI will be saved to file, not only the UID like in your example.

Then you can get the page like this:

```auto
<?php
  if ($slides = $page->slides()->toStructure()) :
      foreach ($slides as $slide) :

          $project = $slide->slideProject();
          echo page($project)->title();

      endforeach;
  endif;
?>

```

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [November 13, 2016, 10:36am UTC](https://forum.getkirby.com/t/page-from-select-field/5750/3 "2016-11-13T10:36:31Z")

</div>

So to answer to my question, yes, I was missing something 😁  
Thanks @texnixe

---

<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:54pm UTC](https://forum.getkirby.com/t/page-from-select-field/5750/4 "2025-02-06T16:54:51Z")

</div>


