Next.js Discord

Discord Forum

Multiple Root Layout

Answered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Hello i am trying to get multiple layouts for my website, i have a root layout that just has html body and head tag


then i have (default) group for the layout that has navbar and footer, and another group (no_layout) that doesnt have a layout so i can ignore footer and navbar

the navbar and footer are nto appearing in the (default) group,

here is the layout page

import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";

export default function RootLayout({ children }) {
  return (
    <html lang="en" className="antialiased">
      <body>

          <Navbar />
          <main className="pt-20">{children}</main>
          <Footer />
      </body>
    </html>
  );
}
Answered by American black bear
yeah i figured, still didnt work, only got fixed after clearing my build cache and restarting the server, thanks for the help tho! @joulev
View full answer

3 Replies

American black bearOP
the docs go over the route layout but only briefly afaik
American black bearOP
yeah i figured, still didnt work, only got fixed after clearing my build cache and restarting the server, thanks for the help tho! @joulev
Answer