# Add the same page to a collection multiple times

**URL:** <https://forum.getkirby.com/t/add-the-same-page-to-a-collection-multiple-times/32146>\
**Category:** Questions\
**Created:** [July 31, 2024, 10:55am UTC](https://forum.getkirby.com/t/add-the-same-page-to-a-collection-multiple-times/32146 "2024-07-31T10:55:19Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![phrank](https://avatars.discourse-cdn.com/v4/letter/p/c67d28/32.png) [@phrank](https://forum.getkirby.com/u/phrank)\
**Post date:** [July 31, 2024, 10:55am UTC](https://forum.getkirby.com/t/add-the-same-page-to-a-collection-multiple-times/32146/1 "2024-07-31T10:55:20Z")

</div>

Hi friends 🙂

is it true, that i cant add the same page to a collection multiple times?

What i want to do:

i am creating an event calendar and some events have multiple dates. To avoid having to add the event multiple times in the panel, i added a field where you can add all event dates.

The output of my calendar first shows the month (August 2024) and then all events in this period. So when an event series takes place in august and september, i want the event to be shown in both months.

Here is what i did:

```auto
  $articles = $page
    ->children()
    ->listed()
    ->filterBy('template', 'event')
    ->filterBy('isEventSeries', false)
    ->filter(function ($child) {
      $compareDate = mktime(0,0,0,date('m'),date('d'),date('Y'));
      return $child->published()->toDate() <= time() && ( $child->eventdate()->toDate() >= $compareDate || $child->eventdateend()->toDate() >= $compareDate );
    });

  $articlesSeries = $page
    ->children()
    ->listed()
    ->filterBy('template', 'event')
    ->filterBy('isEventSeries', true)
    ->filter(function ($child) {
      $compareDate = mktime(0,0,0,date('m'),date('d'),date('Y'));
      return $child->published()->toDate() <= time() && ( $child->eventdate()->toDate() >= $compareDate || $child->eventdateend()->toDate() >= $compareDate );
    });
    
  foreach($articlesSeries as $articleItem) {
    $months = [];
    
    foreach($articleItem->eventSeriesList() as $eventDate) {
      $month = $eventDate->seriesEventdate()->toDate('M');

      if(in_array($month, $months) === false) {
        array_push($months, $month);

        $newItem = $articleItem->update([
          'id' => $articleItem->title() . '-' . $month,
          'title' => $articleItem->title() . '-' . $month,
          'eventdate' => $eventDate->seriesEventdate()->toDate()
        ]);
        $articles->add($newItem);
      }
    }
  }

```

so basically i first get all events that ar not an event-series, then i collect all events which are and compare their dates from the list. for each month i wanted to add the item to my articles collection, but the event is only added once. I also tried to create a new page object which then should be added but the output stays the same. it only appears one time.

Im happy for all ideas. Thanks in advance!

---

_[View the full topic](https://forum.getkirby.com/t/add-the-same-page-to-a-collection-multiple-times/32146)._
