# toPages() is always empty

**URL:** <https://forum.getkirby.com/t/topages-is-always-empty/18959>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 1, 2020, 5:05pm UTC](https://forum.getkirby.com/t/topages-is-always-empty/18959 "2020-08-01T17:05:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![man-oi](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/man-oi/32/8858_2.png) [@man-oi](https://forum.getkirby.com/u/man-oi)\
**Post date:** [August 1, 2020, 5:05pm UTC](https://forum.getkirby.com/t/topages-is-always-empty/18959/1 "2020-08-01T17:05:37Z")

</div>

i have a pages field.  
$page-\>banner() is

> -banner/demoA

$page-\>banner()-\>toPages is empty

the pages are all in draft status. Any ideas why toPages() is always empty but the string resolves fine?

kirby version is 3.4.0

---

<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 1, 2020, 5:44pm UTC](https://forum.getkirby.com/t/topages-is-always-empty/18959/2 "2020-08-01T17:44:52Z")

</div>

The `toPages()` method works only for children not drafts.

Workaround:

```auto
$selectedPages = $page->banner()->yaml();
foreach ($selectedPages as $selectedPage) {
  dump(page($selectedPage));
 
}

```

Or you could create a custom method that converts the selected pages.
