Hi, is it possible for a route resolver to fetch content relationships within a group field?
I have this
And this is the route I'm trying to add:
This completely breaks the route resolver. Ideally I'd like it to fetch all the
services listed under a
person, but even the first
service could work
Welcome to the community!
This is not possible as you have found. It's also not something we're likely to implement as a feature, but I will mark it as a feature request. So, I would recommend rethinking your content modelling.
Can you tell me more about what you're trying to achieve? I'm not sure I understand the use case.
Ah ok, thanks for your reply.
We're trying to achieve a url structure where people can be nested under services. So we have a list of services, e.g.
Web design as a
service type, and a list of people as a
person type. An example of a url would be
The problem is that people can be tied to multiple services, and so we need both
/service/web-design/phil to resolve. This is why you can select multiple
services on a
OK, I understand better.
I'm going to reach out to my team to understand how they implemented something similar to this recently then I'll get back to you.
So, think the only way to create a document with multiple routes would be through a convoluted content model. In Prismic, there's one route per document. So, if you want
/videos/phil , you need two
phil documents. Presumably, you'd create a document for the route with a content relationship to the person and a content relationship to the department.
You might be able to model this in your Next.js pages directory somehow, but any links to Prismic documents won't work.
Having two documents would be too much content duplication for us, so we're gonna scrap the multiple routes idea. Instead we're going to have a
main_service, which is a single content relationship field used for routing, and then an
other_services field for the other relationships that is used for presentational purposes only
Thanks for your help Phil!