# Calendar plugin – display items on home.php

**URL:** <https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705>\
**Category:** Plugins\
**Created:** [May 25, 2024, 4:14pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705 "2024-05-25T16:14:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dersven](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dersven/32/133_2.png) [@dersven](https://forum.getkirby.com/u/dersven)\
**Post date:** [May 25, 2024, 4:14pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/1 "2024-05-25T16:14:51Z")

</div>

i installed successfully the plugin on a subpage calendar. in the template of calendar.php i implemented the snipped. it works.

now I would teaser some next calendar items on the homepage home.php.  
if I insert the snippet code for the data in the subpage I get stucked.

where is my mistake?

```auto
?>
<?php snippet('header') ?>
<?php snippet('intro') ?>
  
<?php $calendar = new Mzur\KirbyCalendar\Calendar($page('calendar')->calendar()->yaml()); ?>

<?php
   snippet('calendar-teaser', [
      'calendar' => $calendar,
      'fields' => [
         'summary' => t('title'),
         'description' => t('description')
      ]
   ]);
?>

```

---

<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:** [May 25, 2024, 7:17pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/2 "2024-05-25T19:17:02Z")

</div>

> [@dersven](#):
>
> `$page('calendar')`

You cannot use $page as function here, you need the page helper: `page('calendar')`

---

<div class="post-metadata">

**Author:** ![dersven](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dersven/32/133_2.png) [@dersven](https://forum.getkirby.com/u/dersven)\
**Post date:** [May 25, 2024, 7:39pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/3 "2024-05-25T19:39:09Z")

</div>

i have tried – but then I get an error 500 on my server installation.

````auto
<?php $calendar = new Mzur\KirbyCalendar\Calendar($page('calendar')->calendar()->yaml()); ?>```
````

---

<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:** [May 25, 2024, 7:42pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/4 "2024-05-25T19:42:47Z")

</div>

> [@dersven](#):
>
> `$page('calendar')`

But that’s still the same error?

Is the page slug correct? Is it a first level page?

---

<div class="post-metadata">

**Author:** ![dersven](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dersven/32/133_2.png) [@dersven](https://forum.getkirby.com/u/dersven)\
**Post date:** [May 25, 2024, 7:54pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/5 "2024-05-25T19:54:33Z")

</div>

yes. ist the home.php and I open the root adress.  
the error is only a „ 500 Internal Server Error“ page.

It sounds like I have a simply rookie failure. ☹

---

<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:** [May 25, 2024, 7:57pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/6 "2024-05-25T19:57:14Z")

</div>

Have you changed `$page('calendar')` to `page('calendar')` now?

What do you get in your home.php template when you just

```auto
dump(page('calendar'));

```

while the rest of the code is commented.

---

<div class="post-metadata">

**Author:** ![dersven](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/dersven/32/133_2.png) [@dersven](https://forum.getkirby.com/u/dersven)\
**Post date:** [May 25, 2024, 8:18pm UTC](https://forum.getkirby.com/t/calendar-plugin-display-items-on-home-php/31705/7 "2024-05-25T20:18:08Z")

</div>

> [@texnixe](#):
>
> `page('calendar')`

oh yeah! I have overread the $ sign. oh what a stupid fail. sorry. iam a rookie  
thanks for your help.
