NextJS layouts
Answered
Serengeti posted this in #help-forum
SerengetiOP
I need to add navbar to all pages except login and signin. How to achieve that?
I tried to put the navbar in the root layour but this is for all pages.
I tried to put the navbar in the root layour but this is for all pages.
Answered by B33fb0n3
you can define multiple root layouts. You can find more information here: https://nextjs.org/docs/app/building-your-application/routing/route-groups#opting-specific-segments-into-a-layout
Please mark the message as solution if it's the solution @Serengeti
Please mark the message as solution if it's the solution @Serengeti
5 Replies
share your code
You can check pathname and not render navbar on login and signin pages
you can define multiple root layouts. You can find more information here: https://nextjs.org/docs/app/building-your-application/routing/route-groups#opting-specific-segments-into-a-layout
Please mark the message as solution if it's the solution @Serengeti
Please mark the message as solution if it's the solution @Serengeti
Answer
good to know
@B33fb0n3 you can define multiple root layouts. You can find more information here: https://nextjs.org/docs/app/building-your-application/routing/route-groups#opting-specific-segments-into-a-layout
Please mark the message as solution if it's the solution <@173115106559787008>
SerengetiOP
Yeah i thought of this method but quite ugli to have paths like (navbar-pages) {...} & (auth-pages) {signin, signup}