I’m working on a project for a client where on certain pages we want to display the next page based on position in admin or alphabetically.
Imagine it like this: we have a page with a list of authors. If you click on an author, you go to the author detail page. On the bottom of that author detail page, we want to link to the next author (alphabetically).
So, in the detail page we want to fetch the story based on the author slug, then the next alphabetical order story after that slug. There seems to be no way of doing that, unless I’m missing something
I’ve tried multiple combinations of filter_query and other filtering methods, but none seem to be able to give me a decisive, expected result.
first_published_at_lt doesn’t work because we might have the case that multiple authors have been published for the first time all at once, resulting in the order not working.
filter_query with the
position property, but since that field is outside of the
content field it doesn’t work.
It feels really overkill to fetch all the authors in every author detail page just to find the next author.
Does anyone know of a good way to go about this without having to manually input “next author” in every authors content story in storyblok?