Working on a website built with Sanity and Next.js where the client want to be able to create curated archive pages, I'm struggling to come up with the best way to approach this. The editorial idea is to have a content type of type archive
that allows to set some params such as category
, content_type
, date range
and order
. These params is then what Next.js should use to present the filtered result. Much like how you can build custom queries with WordPress' Query Loop Block.
The params should ideally not be shown in the URL.
As I see it, I should query archive
, grab the values of the defined filter fields (params
). These then can be used for an additional query where I get the data that I want as it doesn't seem to be possible to run a single query with dynamic values?
However, it's possible to achieve this with Documents Pane: But as I understand, the result of that query cannot be 'saved' to be used in the front end.
Is there some other approach that makes more sense?