Advanced Routing Nuxt with SM

Have a basic Nuxtjs/slice machine app. Can anyone point me to any documentation on how to configure more complex routing? Creating a root page out of box works great (/home), but I need to do a little nesting. (/home/subpage). Both levels need to be dynamic based on the content in prismic. I was thinking I had to create a subpage type with it's own UID and a relationship field pointing to the parent page, but I'm not sure how to wire it up.

In the end, what I want in the routing is for all my pages built off the main page custom type to route to "/uid", which works out of box, and I want all the pages build off the subpage custom type to route to "/parentuid/uid". If my subpage type has a content relationship field pointing to the main page, can I grab the UID of that main page and use it in my route?

Hey Shawn,

You should check out the Route Resolver documentation on the Slicemachine website which explains how to do exactly that:

We configured SM with the nuxt module to make this super easy.

Thanks.

Thank you...I was looking at the link resolver docs in the prismic doc site. Appreciate you pointing me in the right direction.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.