Calendar library installation

My installation of the Calendar board worked perfectly.
I’m trying now to install the Calendar library by Bastian Allgeier but I don’t know where to put the files !
Is the calendar.php file a snippet ? a template ? And the three files month/week/year.php, where to put them ?

Sorry for my noob question, thanks in advance.

The calendar library is not Kirby specific, I think.

I’d put it in the plugin folder /site/plugins/calendar/calendar.php.

The year, month, week files are usage examples, you would have to adapt them for use with Kirby. If you use the library with Kirby, you don’t have to require the calendar.php file anymore.

I have put the plugin in the folder like you said, but if it’s not necessary with Kirby (?!) I have removed it.
But the librairy seems to contain a navigation switch system to year/month/week files and I would love to use it. So I paste this code in the header.php file:

        <li><a<?php if($activeTab == 'week') echo ' class="active"' ?> href="week.php">Week</a></li>
        <li><a<?php if($activeTab == 'month') echo ' class="active"' ?> href="month.php">Month</a></li>
        <li><a<?php if($activeTab == 'year') echo ' class="active"' ?> href="year.php">Year</a></li>

<?php echo css('assets/css/calendar.css') ?> with the calendar CSS into the assets folder

After that, I have paste the three files week.php/month.php/year.php into the snippet folder. Then, I created a “calendrier” visible page from the menu bar, but I don’t know what kind of code could I put in my template to make the calendar visible.

It is necessary to put the plugin in the plugins folder. What I meant is, that the example files require() the calendar.php file, which is not necessary if the file is loaded as a plugin.

Thank you. I can see now the “year” calendar. I deletted these things :


But in my calendar, I don’t see my event and my Calendar board installation works fine. This is my code

    <?php foreach($currentYear->months() as $month): ?>
      <h2><a href="month.php?year=<?php echo $month->year()->int() ?>&month=<?php echo $month->int() ?>"><?php echo $month->name() ?></a></h2>
          <?php foreach($month->weeks()->first()->days() as $weekDay): ?>
          <th><?php echo $weekDay->shortname() ?></th>
          <?php endforeach ?>
        <?php foreach($month->weeks(6) as $week): ?>
          <?php foreach($week->days() as $day): ?>
          <td<?php if($day->month() != $month) echo ' class="inactive"' ?>><?php echo ($day->isToday()) ? '<strong>' . $day->int() . '</strong>' : $day->int() ?></td>
          <?php endforeach ?>  
        <?php endforeach ?>
    <?php endforeach ?>

And last thing, when I click on the months links (January, February,…), or switch to week or month, it get a 404 error. So I think I did something wrong.

Unfortunately, I haven’t used the library myself yet, so I can’t help you without having a deeper look into it. Maybe the creator of Calendar board, @molocLab, can lend a helping hand at combining the two?