How do I hide root layout on some pages?
Unanswered
Argentine hake posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Argentine hakeOP
In the app directory, whatever is in layout.tsx get shown in all pages, but what if I don't it to be shown on specific pages, for example, login, payment page etc, how can I do it?
19 Replies
![Avatar](https://cdn.discordapp.com/avatars/1053443057451794585/2cfe63fa4e9e4365c036000c008bd6f6.webp?size=256)
!=tgt
make another layout.tsx inside a child folder
which will override it
like /login/layout.tsx
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Argentine hakeOP
in that case, that layout.tsx becomes root layout.tsx children nah?
![Avatar](https://cdn.discordapp.com/avatars/1053443057451794585/2cfe63fa4e9e4365c036000c008bd6f6.webp?size=256)
!=tgt
nope
it's it's own
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Argentine hakeOP
what if I want it to be root layout children? lets say root layout got navbar, and child layout got sidebar for categories, which is common for a lot of child pages, how can i achieve it?
![Avatar](https://cdn.discordapp.com/avatars/1053443057451794585/2cfe63fa4e9e4365c036000c008bd6f6.webp?size=256)
!=tgt
I don't think you could do that
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Argentine hakeOP
![Image](https://cdn.discordapp.com/attachments/1205923327902879785/1205925357157621760/Screenshot_2024-02-10_225932.png?ex=65da2482&is=65c7af82&hm=0028ab941fe280e94be044afcfdb4e0b500739b68e913e6bc47725b0f6f83630&)
for example above page
![Avatar](https://cdn.discordapp.com/avatars/209129015154311171/a_a38e73816872a7950286c2727aad749c.gif?size=256)
Smultar.json
@Argentine hake try using route grouping.
Each route group folder has a seperate layout, and only renders the URL that is called.
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Blackpoll Warbler
I have managed to achieve the seperation of the root layout by having a (root) grouped with a page.tsx defined in there
(root) -> page.tsx
app->src->layout.tsx
Now my /login/ route isnt affected by the root layout
Dont know how this is supposed to work but it works, came here to ask if this is the correct practices and if not might even be a bug?
![Avatar](https://cdn.discordapp.com/embed/avatars/3.png)
Blackpoll Warbler
** also make sure to add your template that you want to have applied to your root page im not sure if the template is needed