maintaining URL path structure but without using parent layout
Answered
American black bear posted this in #help-forum
American black bearOP
Hey,
is it possible for me to not use a layout even if its in a child of the layout in nextjs?
for example:
i cant really change this structure because of tech dept with my old siter, it would cause lots of URLS to be broken
I need my transcripts at url:
is it possible for me to not use a layout even if its in a child of the layout in nextjs?
for example:
dashboard
- [guildId]
// this should use the 'layout'
- logs
page.tsx
- tickets
- transcripts
- [ticketId]
- view
page.tsx
page.tsx
layout.tsx // i dont want to use this inside of 'tickets' folderi cant really change this structure because of tech dept with my old siter, it would cause lots of URLS to be broken
I need my transcripts at url:
/dashboard/[guildId]/tickets/transcripts/[ticketId]/view but without using the dashboards root layout.Answered by joulev
(with-layout)/
dashboard/
page.js <- /dashboard
layout.js
(without-layout)/
dashboard/
whatever/
page.js <- /dashboard/whateverref: https://nextjs.org/docs/app/building-your-application/routing/route-groups
3 Replies
@American black bear Hey,
is it possible for me to not use a layout even if its in a child of the layout in nextjs?
for example:
ts
dashboard
- [guildId]
// this should use the 'layout'
- logs
page.tsx
- tickets
- transcripts
- [ticketId]
- view
page.tsx
page.tsx
layout.tsx // i dont want to use this inside of 'tickets' folder
i cant really change this structure because of tech dept with my old siter, it would cause lots of URLS to be broken
I need my transcripts at url: `/dashboard/[guildId]/tickets/transcripts/[ticketId]/view` but without using the dashboards root layout.
(with-layout)/
dashboard/
page.js <- /dashboard
layout.js
(without-layout)/
dashboard/
whatever/
page.js <- /dashboard/whateverref: https://nextjs.org/docs/app/building-your-application/routing/route-groups
Answer
i forgot to say but this works perfectly.