Layout.tsx issue
Answered
In&Out posted this in #help-forum
In&OutOP
| layout.tsx
| page.tsx
|
+---(editor)
| \---editor
| | layout.tsx
| | page.tsx
| |
| +---[...custom_page]
| | | layout.tsx
| | | page.tsx
| | |
| | \---_components
| | | Sidebar.module.css
| | | Sidebar.tsx
| | | UserCompound.module.css
| | | UserCompound.tsx
| | |
| | +---elements
| | | | ElementsList.module.css
| | | | ElementsList.tsx
| | | | Helpers.tsx
| | | |
| | | \---img
| | | nd.jpg
| | | Np.png
| | | vesti_1.png
| | | vesti_2.png
| | | vesti_3.png
| | |
| | +---sidebar
| | | | ElementSidebar.tsx
| | | | ExtraSidebar.module.css
| | | | ExtraSidebar.tsx
| | | | TextSidebar.tsx
| | | | ThemeSidebar.tsx
| | | |
| | | \---css
| | | ElementSidebar.module.css
| | | TextSidebar.module.css
| | | ThemeSidebar.module.css
| | |
| | \---store
| | dashboardStores.tsx
| |
| \---_components
| | Main.module.css
| | Sidebar.tsx
| | UpperNavbar.tsx
| |
| +---css
| | Sidebar.module.css
| | UpperNavbar.module.css
| |
| \---helpers
| +---sidebar
| | Editor.module.css
| | Editor.tsx
| | Pagepicker.module.css
| | Pagepicker.tsx
| |
| \---uppernav
| SaveButton.module.css
| SaveButton.tsx
|
\---_componentsAnswered by Giant panda
You just need something like this:
/dashboard/(editor)/editor/layout.tsx
/dashboard/(everything-else)/...14 Replies
In&OutOP
i have issues with nextjs layouts, in 1 folder i have 5 routes for dashboard, all will have 1 layout except /dashboard/editor which will have own layout, how do i make editor only use layout thats in that folder while others use layout in /dashboard
Giant panda
Using route groups - check the docs how to split your pages using those, allowing for separate layouts.
i did that already, see top of that folder structure
or do i have to remove it from folder
Giant panda
Most of your hierarchy you posted is not helping to understand your actual structure. You just have to ensure the path you want a separate layout for is in a separate group to everything else.
Giant panda
You just need something like this:
/dashboard/(editor)/editor/layout.tsx
/dashboard/(everything-else)/...Answer