#Multiple Layouts in App directory

9 messages · Page 1 of 1 (latest)

somber trench
#

So i know we need to have a layout file in the app directory.
I also know that this can be done server side - which should allow us to connect to a DB (mongodb) and fetch sites logos, images etc - not sure though.

The question however is can you have a totally different layout.tsx file in a subfolder like dashboard for example?

also can we still use hooks to load themes?

like something like this which is currently in /hocs folder

cinder zephyr
somber trench
cinder zephyr
#

Assuming you want the layouts to be scoped specifically to those pages, yes. Any folder surrounded by parentheses is ignored in the route

#

As long as there is only one page.tsx in the base level of one of the two (or however many) folders you have, it will load that as the home page.
Just think of it as you're scoping those layouts to specific pages, the rest of the file structure is exactly the same and is treated exactly the same

cinder zephyr
cinder zephyr
somber trench
cinder zephyr