Question: I’m following the dynamic driven page guide for NextJS and I would like to know how I would setup my page template in Plasmic Studio to receive the props once the page(s) are generated.
updated: resolved.
Question: I’m following the dynamic driven page guide for NextJS and I would like to know how I would setup my page template in Plasmic Studio to receive the props once the page(s) are generated.
updated: resolved.
also does this guide account for a index route, meaning:
/products/
-> / *index for product route
|
-> /products/[slug]. *goes to a single product page
Hi @useful_gibbon, the index route should be something you can treat separately (Next.js doesn’t include it in the dynamic route handler)
Thank you @yang, I managed to resolve this through reviewing the Github example. Very excited that this is supported!
I do have one follow up question, is there a way to pass the slug
via meta props or custom page props in the Studio UI? Currently I am pulling via next/router
const router = useRouter();
const { slug } = router.query;
async function getData() {
..........
{ slug: slug ? slug : 'introduction' },
requestHeaders
);
setLesson(data);
}