Calendar plugin – display items on home.php

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?

?>
<?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')
      ]
   ]);
?>

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

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

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

But that’s still the same error?

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

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. :frowning:

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

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

dump(page('calendar'));

while the rest of the code is commented.

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