0

I have a page set up in this format

original reset image

I looked at forums and it said i should change the inner layout page to __layout@reset.svelte. However when i do that, I get another error.

reset image using @reset instead of .reset
Does anyone know how i can put in a reset __layout inside of a folder and get it to override the parent layout?

  • Does this answer your question? [how to handle reset layout?](https://stackoverflow.com/questions/71789793/how-to-handle-reset-layout) – Thomas Hennes May 12 '22 at 15:49

3 Answers3

0

Your error is because __layout@reset.svelte would be looking for a __layout-reset.svelte file in it's current directory, or any parent directory directory, to be a sub-layout for. You don't have a __layout-reset.svelte file.

As Thomas Hennes mentioned in the other thread. If you wanted to have it act like the reset, you'd need to create a __layout-reset.svelte file in the current folder or (more useful for the entire app, in the root folder) and have it be a blank <slot />. From there, you can do __layout@reset.svelte to which will allow you to make a completely new layout.

Josh
  • 51
  • 3
0

I think that you can solve this problem by fallowing this steps :

  1. Create "__layout-choseNameYouWant.svelte" at the same level as "__layout.svelte"
  2. Create "guides@theSameNameYouGaveForLayoutFile.svelte" at the same level as about.svelte
jugurtha moad
  • 304
  • 3
  • 5
0

Layouts can themselves choose to inherit from named layouts

  1. create "__layout-root.svelte" at the same level as index.svelte and about.svelte with the following code <slot/>
  2. create "__layout@root.svelte" in guides folder with the following <slot></slot>
jugurtha moad
  • 304
  • 3
  • 5