Next.js Discord

Discord Forum

What would be route structure?

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I want to make routes that look like this,

example.com/parentCategory/newsId
example.com/parentCategory/category/newsId


so, parentCategory, category, newsId these are dynamic.

I went with

app/
   [parent_slug]
     - page.tsx
     - [child_slug]
         - page.tsx
     - [details_slug]
         - page.tsx


Now, how could I show the details slug in the parent slug or child slug?

Thanks for your help.

1 Reply

Cape lion
you have to move your details_slug
folder under child_slug folder

that way you will get
example.com/child_slug/details_slug