Closed magicspon closed 6 months ago
You indeed need to have information (parent and slug) for all the pages in order to resolve URLs. This package also includes a client with a method called getAllPageMetadata. It retrieves the bare minimum data for all the pages (_id, type, slug, and parent) and resolves the URL for each page. With the returned data, you can retrieve the documentId for a URL and fetch your content afterward.
We don’t have plans to store a uri property on every page document. We did consider it, saving this information before the publish action, but the editor experience would be worse and would make the implemenation more complex. Especially when you change, for example, a slug of one of the pages higher in the tree and have to update all the children.
However, it’s possible to implement this yourself by creating a custom publish action and updating all the child pages. Or do this async with a webhook.
fair enough. i imagine it would be a bit of a pain to implement.
Hello..
It would be great if each tree entry was automatically given a hidden uri field, generated from it's parents (and parents parents) slugs.
example groqd query.
if I want to get
/a/b/c/d
i need to write a query like so:which is a bit knarly!
what would be great is an
uri
fieldWould something like this be possible to add