Calendar Loop pagination

Trying to build a simple calendar view but paginating between months doesn’t seem possible. I tried to limit the month loop to 1 month per “page” with 12 pages. What am i missing?

<Loop type=calendar_year>

  <h1><Field year /></h1>

  <Loop field=month count=1 paged=12>
    <h2><strong><Field name/></strong></h2>
    <Loop field=day>
      <span><Field day/></span>
    </Loop>
  </Loop>
  <PaginateButtons />
</Loop>
1 Like

Okay so after fiddling around, this seemed to work!

<Loop type=calendar_month paged=1 year=current>
  <h1><Field name /></h1>
  <div>
  <Loop field=day>
      <span><Field day/></span>
      <span><Field short_name/></span> |      
  </Loop>
  </div>
</Loop>
<div style="margin-top:16px;">
<PaginateButtons />  
</div>
1 Like

i see another problem - changing year=current to year=2020 doesn’t seem to affect the “Field year” in the output.

<Loop type=calendar_month year=current>
  <div><Field name /> <Field year /></div>
</Loop>

Output with Loop type=calendar_month year=2020 set
January 2022
February 2022
March 2022
April 2022
May 2022
June 2022
July 2022
August 2022
September 2022
October 2022
November 2022
December 2022

I haven’t played around much with the calendar loop yet myself, but it’s interesting to see that pagination does seem to work on calendar loops to some extent even though this isn’t an official feature (yet)! It makes sense that the template in your first post wouldn’t work since in the current implementation of pagination, the <PaginateButtons /> tag needs to be placed outside a loop and in your first example, it was placed inside. I’m not sure if it’s currently possible to loop multiple instances of pagination as you’re trying to do, so that might be where things are breaking. I know that work is underway to make the pagination options a lot more flexible so that should make this kind of thing easier to achieve.

This part does indeed seem like a bug so I’ve reported it to the dev team and I’ll report back here when it’s been resolved.