# First page of collection as homepage

**URL:** <https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607>\
**Category:** Questions\
**Tags:** v3\
**Created:** [September 30, 2022, 10:36am UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607 "2022-09-30T10:36:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mafleig](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mafleig/32/15806_2.png) [@mafleig](https://forum.getkirby.com/u/mafleig)\
**Post date:** [September 30, 2022, 10:36am UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/1 "2022-09-30T10:36:12Z")

</div>

Hi,

is it possible to redirect the first page of a collection (e.g. first project of a portfolio) as homepage? like here in the config.php:

```auto
return [
    'home' => 'projects'
];

```

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [September 30, 2022, 10:48am UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/2 "2022-09-30T10:48:32Z")

</div>

Not tested this but i think you should be able to do either of these (assuming you have a projects collection setup already):

```auto
return [
    'home' => kirby()->collection('projects')->first()->id()
];

```

or

```auto
return [
    'home' => site()->find('projects')->children()->listed()->first()->id()
];

```

---

<div class="post-metadata">

**Author:** ![mafleig](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mafleig/32/15806_2.png) [@mafleig](https://forum.getkirby.com/u/mafleig)\
**Post date:** [September 30, 2022, 11:44am UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/3 "2022-09-30T11:44:47Z")

</div>

looks promising, but both throw an error so far. 🙁

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [September 30, 2022, 11:48am UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/4 "2022-09-30T11:48:26Z")

</div>

What was the error?

---

<div class="post-metadata">

**Author:** ![mafleig](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mafleig/32/15806_2.png) [@mafleig](https://forum.getkirby.com/u/mafleig)\
**Post date:** [September 30, 2022, 12:32pm UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/5 "2022-09-30T12:32:32Z")

</div>

first one:  
**Fatal error** : Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in **/…/kirby/config/helpers.php** on line **276**

second one:  
**Fatal error** : Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in **/…/kirby/src/Cms/Core.php** on line **334**

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [September 30, 2022, 12:47pm UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/6 "2022-09-30T12:47:48Z")

</div>

Hmm yes its running out of ram and needs another 20+ gigbytes, so its obviously going round in circles. Not really sure where to go from here to be honest.

---

<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:** [September 30, 2022, 4:10pm UTC](https://forum.getkirby.com/t/first-page-of-collection-as-homepage/26607/7 "2022-09-30T16:10:30Z")

</div>

You cannot call kirby() or site() in the config, unless you do so within the `ready` option. You can set your home option there:

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