Layout - Nesting Heirarchy

Does Aurelia support nested layouts?

1 Like

Can you show some pseudo code? And it should

Can you provide any simple example? Pseudo code seems pointless in this basic scenario, just want to know if possible and how.

How can a layout be set to “inhertit” or use another layout?

1 Like

Is the convention to simply make components of the layout sections and just form up inherited layout structure via said components and always only have 1 layout specified per view?

I know about viewports, was trying to see if layouts can be shared and inherited from in a straightforward sense…

1 Like

I rarely used layout myself, thats why i was asking some pseudo code so i can see what you trying to avhieve and seeif theres any issues to help with. Maybe lets wait for folks with some layout nesting experience. My basic point of view is layout works similarly like compose element, sso theres no reason it cant support nesting but i could be wrong, since i didnt understand what you really mean with nesting

If you mean layouts as in the traditional ASP.NET idea of master pages with placeholders, the SPA equivalent of that would be a custom element with slots (or, specifically in Aurelia, replaceable parts).

E.g. you declare a custom element:

<template>
  <div>Header</div>
  <slot></slot>
  <div>Footer</div>
</template>

And consume it like so:

<my-custom-element>
  <div>Content</div>
</my-custom-element>

Final output:

<my-custom-element>
  <div>Header</div>
  <div>Content</div>
  <div>Footer</div>
</my-custom-element>
1 Like