I would going to have the documents wrap themselves in the appropriate html containers based on their location in the document tree.
For example, look at the markup of this page:
http://www.fredsbarn.com/sandbox/multiflex3/layout4_full.html
The layout basically uses a container called "main-content." Inside that container are "content-units." Each "content-unit" can contain a "1-column-unit," "2-column-unit-left," "2-column-unit-right," "3-column-unit-left," "3-column-unit-middle," and "3-column-unit-right." Further any of those "column-units" can contain "text-units."
So to be able to dynamically create the layout, I thought I would have to use nested ditto calls using my template hack I did to ditto. For example I would set up the documents for a lengthy page like this:
Page
Main Content
Content Unit A
1-column-unit
text-unit
text-unit
Content Unit B
2-column-unit-left
text-unit
text-unit
2-column-unit-right
text-unit
text-unit
Uses my hack, each document would determine what chunk to call as its template. So in the "Page" you would do your ditto call starting at "Main Content," which would create Content Unit A and B on the "Page." But the contents of Unit A and B would be ditto calls to what is within them and so on, so that it builds the appropriate html structure dynamically to look like this:
<!-- Content unit - One column -->
<div class="content-unit">
<div class="column1-unit">
<div class="text-unit">
*CONTENT*
</div>
<div class="text-unit">
*CONTENT*
</div>
</div>
</div>
<!-- Content unit - Two columns -->
<div class="content-unit">
<div class="column2-unit-left">
<div class="text-unit">
*CONTENT*
</div>
<div class="text-unit">
*CONTENT*
</div>
</div>
<div class="column2-unit-right">
<div class="text-unit">
*CONTENT*
</div>
<div class="text-unit">
*CONTENT*
</div>
</div>
</div>
Now using the ditto calls that return data that was a ditto call would allow me to build this data structure in a recursive way. On the other hand, the user has to set his data up in this type of structure. I am trying to also alter the template to maintain its flexibility, while simplifying all the containers that are used as. For instance, text-units could probably be emulated by just using header tags, and thus eliminates a container. But I am no CSS wiz by any means, and I am sure there is a simpler way. So if so, let me know. Then end goal is to have a template that is has flexible as he intended it, and not just porting it in such a way that the user is forced into a very fixed template that I decided to place a couple TVs to. The more I think about it, it is kind of like using the method Wayfinder does to build its menu’s by using the [+wf.wrapper+]. Except I need the documents to wrap themselves in their appropriate wrapper. Is there an easier, more elegant, and more efficient way to do this? I am probably trying to put a square peg in a round hole, eh?
Jesse