Creating nested layouts

Enonic version: 6.0
OS: Windows 7 x64

In official documentation I have found that layouts can be nested.
http://xp.readthedocs.org/en/latest/developer/layout/index.html?highlight=layout
– “Layouts can even be nested.”

But when I am trying to put layout on layout in UI, I am getting message “Layout with layout is not allowed”. So can I create nested layouts or I can’t?

Whops… The documentation is wrong here. At the moment we have intentionally disabled layouts in layouts to avoid complex scenarios for developers - and potential pitfalls for the users.

However, we have discussed supporting layouts in layouts for defined cases:,
I.e. if the developers creates a 1 column layout that simply adds nice padding or similar. It would indeed be interesting to place this layout inside other layouts? In that case the developer would have to declare that this layout can be placed inside other layouts? What do you think?

2 Likes

It would be greate, because I was digging about pretty much same posibility =) But ok, for now I think I can put parts on layout in my case.

You could for instance have a form layout to put inside other layouts…