2
votes

I've read the docs on layouts and regions, however I'm struggling to understand which one is at the top level. I'm starting on my initial application which will have a few core structural layouts. The question becomes, do I create a main container region and attach layouts per core structural layout (which would then have sub regions for widgets, etc )? Or do I create a layout which creates the main DOM element that can be switched out at the top. I guess I'm having an issue understanding in the sense of which comes first, the chicken or the egg or in the scope of marionette layouts and regions. I would assume a region given that a layout is basically an item view and item views are typically attached to a region.

In short, can I start my initial application with a layout which then has regions and sub layouts, etc? Or should I start my application with a main region which then has sub layouts and regions.

1

1 Answers

2
votes

After a bit more googling, I think the answer has become clear. I first need to create a region where layouts can be added to. This is further described at http://davidsulc.com/blog/2012/05/06/tutorial-a-full-backbone-marionette-application-part-1/.

In my use case I would create a main container region which other layouts can be added to. Those layouts could then have sub regions and those sub regions could have layouts, thus infinitely expanding.