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
ahh, use route groups
@Shaurya 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?
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
@Ray use route group
(with-nav)/layout.tsx <-- render Nav here
(with-nav)/page.tsx
/login/page.tsx
shouldn't there be two different route gruops? (with-nav) & (without-nav)?
oh
got it
nvm
@averydelusionalperson shouldn't there be two different route gruops? (with-nav) & (without-nav)?
the default one without nav lol
@Ray the default one without nav lol
yeah, got confused, I read it like
(with-nav)/page.tsx/login/page.tsx
instead of seperate lines@Shaurya can you please elaborate, didn't understand
this is my structure
create 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.Answer
checkout docs here
@averydelusionalperson create 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.
ShauryaOP
so the home page
/app/page.tsx
would be /app/withnav/page.tsx
right?oh
the parentheses
got it, lemme do that
ShauryaOP
thanks, works perfect, didn't have use of routing groups before