Next.js Discord

Discord Forum

Approach doing dynamic multi column layouts

Unanswered
Jumbo flying squid posted this in #help-forum
Open in Discord
Jumbo flying squidOP
Hello everyone,

i just started Learning Next.JS and i came upon a problem i wasn't really able to solve.
My Structure looks like this right now:
.
└── src/
    └── app/
        ├── components/
        │   └── sidebar.tsx
        └── dashboard/
            └── [slug1Id]/
                ├── layout.tsx
                ├── page.tsx
                └── slug2/
                    └── [..slug2Id]/
                        ├── layout.tsx
                        └── page.tsx


When i access
/dashboard/slug1

I want my dashboard to look something like the first image shows.
This part works as it should be. But now comes part where i struggle.

when i access /dashboard/a/slug2/a/b... i want my Dashboard to look like the second image shows.

I tried several things with the layout.tsx but i dont get it quite right. What is the right approach for handling this kind of stuff? Do i use parallel routes? These didnt seem to work for me quite right.

1 Reply

Black Scoter
I want your source code.