How to get slugs from parent documents in Sanity Studio using custom slugify function.
Last updated: Jan 26, 2022
Is there a method in the Studio to get the slugs from all parent documents? I have a nested structure of
and I’d like to get the chapter and module slugs when fetching the section
Jan 25, 2022, 11:33 PM
I think the best approach would be to create a custom slugify function that does this for you. There's not a neat and tidy way to do it, though. If it's set up that the section references a chapter, which then references a module, the following will work: *Note: you will need to install slugify and import the sanity client for this to work.