Next.js Discord

Discord Forum

Help understanding layouts

Unanswered
Short mackerel posted this in #help-forum
Open in Discord
Original message was deleted.

10 Replies

Short mackerel
I want my main website to be at / but then when I go to /login it displays a login page just without the rootlayout from /
Currently the rootlayout has a header, navigation menu, etc
How does your project structure look like? You may be using route groups with different root layouts for each one.
By the way, a note for any future forum posts: never delete the original message.
@not-milo.tsx How does your project structure look like? You may be using route groups with different root layouts for each one.
Short mackerel
Yeah sorry about the delete, I thought a delete would delete the forum post since I no longer needed help. As for what I decided to do is use groups to create two separate areas and then placed a root layout different for each one. So under (main) I have a root layout for the website section and under (dashboard) I have a root layout for a separate dashboard area
Whereas before, I had a root layout just in the base of the app directory
Short mackerel
Is this correct?
Under promotional is my / where my website will be. Then under the grouped routes under (dashboard) have a separate header, footer, etc
Yes, that would be a correct use of route groups 👍🏻