Multiple Root Layout
Answered
American black bear posted this in #help-forum
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
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
3 Replies
American black bearOP
the docs go over the route layout but only briefly afaik
@American black bear 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
js
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>
);
}
if you already have <html> and <body> in an upper layout you shouldn't have it in the lower layout because you don't want to have this
<html>
<body>
<html>
<body>
...
</body>
</html>
</body>
</html>
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