# Set homepage as first page in a folder

**URL:** <https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239>\
**Category:** Questions\
**Tags:** v3\
**Created:** [December 3, 2020, 11:39pm UTC](https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239 "2020-12-03T23:39:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbojones](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jimbojones](https://forum.getkirby.com/u/jimbojones)\
**Post date:** [December 3, 2020, 11:39pm UTC](https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239/1 "2020-12-03T23:39:11Z")

</div>

Hi there, I’m effectively looking for a Kirby 3 solution to this old question — [‘Set homepage as most recent content post’](https://forum.getkirby.com/t/set-homepage-as-most-recent-content-post/10345).

Which was using `c::set('home', page('home')->children()->last());` in the config. It seems this doesn’t work with Kirby 3.

In this case, I’d like to set the homepage as the _first_ page in a ‘work’ folder. So no articles or dates, just whatever the first page is in the work folder.

I know I can solve this by repeating similar code as my work page into my home.php, but would prefer not to load 2 pages if possible!

Thanks again any help is greatly appreciated!! ☀

---

<div class="post-metadata">

**Author:** ![ahmetbora](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ahmetbora/32/11671_2.png) [@ahmetbora](https://forum.getkirby.com/u/ahmetbora)\
**Post date:** [December 4, 2020, 6:49am UTC](https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239/2 "2020-12-04T06:49:04Z")

</div>

There is a new `home` option for this on Kirby 3. You can set from `config.php` like that:

```php
// site/config/config.php
return [
  'home' => 'work'
];

```

> **[home](https://getkirby.com/docs/reference/system/options/home)**
>
> Set the name of the home page folder

---

<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:** [December 4, 2020, 7:53am UTC](https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239/3 "2020-12-04T07:53:56Z")

</div>

To set a page dynamically, you can set the home option within the `ready` option:

```auto
'ready' => function() {
    return [
        'home' => page('work')->children()->listed()->sortBy('date', 'desc')->last(),
    ];
},

```

> **[ready](https://getkirby.com/docs/reference/system/options/ready)**
>
> Inject last minute configuration options

---

<div class="post-metadata">

**Author:** ![jimbojones](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jimbojones](https://forum.getkirby.com/u/jimbojones)\
**Post date:** [January 13, 2021, 12:47am UTC](https://forum.getkirby.com/t/set-homepage-as-first-page-in-a-folder/20239/4 "2021-01-13T00:47:09Z")

</div>

Thanks @texnixe! Really appreciate your help with this one. `Ready` is a very useful function.

For the record, I only needed the first work item listed so my code looks like this:

```
// site/config/config.php

return [
    'ready' => function ($kirby) {
        return [
                'home' => page('work')->children()->listed()->first(),
            ];
    }
];
```
