Layouts
Answered
Shaurya posted this in #help-forum
ShauryaOP
I have a layout which have nav and stuff but I don't want the layout to the login page, how would I do that?
Answered by averydelusionalperson
18 Replies
averydelusionalperson
ahh, use route groups
Ray
use route group
(with-nav)/layout.tsx <-- render Nav here
(with-nav)/page.tsx
/login/page.tsx
(with-nav)/layout.tsx <-- render Nav here
(with-nav)/page.tsx
/login/page.tsx
averydelusionalperson
shouldn't there be two different route gruops? (with-nav) & (without-nav)?
oh
got it
nvm
Ray
the default one without nav lol
ShauryaOP
can you please elaborate, didn't understand
this is my structure
this is my structure
averydelusionalperson
yeah, got confused, I read it like
(with-nav)/page.tsx/login/page.tsx
instead of seperate linescreate a folder named
(with-nav)
, and in that keep your pages with nav bar, and layout with navbar, and outside of that folder keep other pages without those nav bar.averydelusionalperson
Answer
averydelusionalperson
checkout docs here
ShauryaOP
so the home page
/app/page.tsx
would be /app/withnav/page.tsx
right?oh
the parentheses
got it, lemme do that
averydelusionalperson
yeah, like this 👇
ShauryaOP
thanks, works perfect, didn't have use of routing groups before