# Show drafts in the front end

**URL:** <https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 8, 2019, 1:32pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189 "2019-08-08T13:32:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_gareth\_j](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/_gareth_j/32/4694_2.png) [@\_gareth\_j](https://forum.getkirby.com/u/_gareth_j)\
**Post date:** [August 8, 2019, 1:32pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/1 "2019-08-08T13:32:15Z")

</div>

Is it not possible to show draft pages in the front end? I tried this:

```
<?php foreach ($page = $page->children()->draft() as $page): ?>
<?= $page->title() ?><br/>
<?php endforeach ?>

```

---

<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 8, 2019, 1:36pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/2 "2019-08-08T13:36:35Z")

</div>

Should be

```auto
foreach ($page->drafts() as $draft) {
  // do stuff
}

```

This should return all draft children only. If you want both children and drafts, then use `childrenAndDrafts()` instead.

---

<div class="post-metadata">

**Author:** ![\_gareth\_j](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/_gareth_j/32/4694_2.png) [@\_gareth\_j](https://forum.getkirby.com/u/_gareth_j)\
**Post date:** [August 8, 2019, 1:50pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/3 "2019-08-08T13:50:58Z")

</div>

ok makes sense, cheers!

---

<div class="post-metadata">

**Author:** ![\_gareth\_j](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/_gareth_j/32/4694_2.png) [@\_gareth\_j](https://forum.getkirby.com/u/_gareth_j)\
**Post date:** [August 8, 2019, 3:48pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/5 "2019-08-08T15:48:04Z")

</div>

yes, this ok for my use 👍

---

<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 8, 2019, 3:56pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/6 "2019-08-08T15:56:06Z")

</div>

> [@\_gareth\_j](#):
>
> yes, this ok for my use 👍

But the information is not correct. If you explicitly show the drafts, then everyone can see them.

---

<div class="post-metadata">

**Author:** ![\_gareth\_j](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/_gareth_j/32/4694_2.png) [@\_gareth\_j](https://forum.getkirby.com/u/_gareth_j)\
**Post date:** [August 8, 2019, 4:01pm UTC](https://forum.getkirby.com/t/show-drafts-in-the-front-end/15189/7 "2019-08-08T16:01:11Z")

</div>

My whole site is for logged in users only.
