Hi,

I'm using statamic to make a "courses" website. I've created a fieldset for courses, chapter pages and a fieldset for an actual course page. The structure will be this:

  • course fieldset
    • chapter fieldset
      • page fieldset
      • page fieldset
    • chapter fieldset
      • page fieldset
      • page fieldset

I did it like this because I couldn't find a way to make a course a collection but still group the pages by chapter.

But I want my students to be to go to the previous and next page on a course page. I found the "pages:next" and "pages:previous" but this only looks at the child pages.

If I'm at the last page of a chapter I want the "next" link to be the first page of the next chapter. The same goes for previous. If I'm at a "first" page I want to go back to the last page of the previous chapter.

I've been cracking my head about how to do this with one of the Nav tags but can't find a solution.

Anybody have an idea on how to accomplish this?