Question about Implementing a 5-Level Menu in Prismic with Next.js & TypeScript (Multi-language Support)
Issue
I'm using Next.js with Prismic to build a website with a 5-level menu while supporting multiple languages (lang
). However, I'm facing issues defining routes and link resolvers in Prismic to ensure child pages follow the correct structure.
Requirements
- Desired URL Structure
- Support
lang
at the beginning (e.g.,/en/
,/vi/
) - Multi-level menu:
/:lang/products-services
/:lang/products-services/network-services
/:lang/products-services/network-services/cloud-services
/:lang/products-services/software-applications
/:lang/products-services/software-applications/fintech/blockchain
const routes: prismic.ClientConfig["routes"] = [
{
type: "homepage",
path: "/:lang?", //working
},
{
type: "page",
path: "/:lang?/:uid", //working
},
{
type: "nested_page",
path: "/:lang?/:uid/:pagePath", //not working
},
];
Please guide how to organize routing properly and correctly at level 3 and above in nextjs15 and typscript