#setting up different layout.tsx

4 messages · Page 1 of 1 (latest)

raw patio
#

I'm new to qwik and would like to setup a full website along with an admin dashboard so for both website and admin dashboard pages i need to use different header, footer etc i tried to add layout.tsx inside /admin route folder but it doesn't work. may i know what went wrong?

dusky gazelle
#

You could conditionally render header in the root layout depending on whether you’re on an admin page. If you have a nested layout the root layout will wrap around that layout which I’m guessing is not the desired outcome.

raw patio
#

this is my current file structure

- routes
-- admin
--- index.tsx
--- layout.tsx
-- about
--- index.tsx
-- index.tsx
-- layout.tsx

i have setup different header and footer components for both root files, about page etc and for admin pages
i need to use 1 set of header and footer for all pages including root and 2nd set only for pages under admin like /admin/dashboard /admin/orders etc

#

but right now only the header and footer used for all other pages is applied even for admin pages