The text below elaborates on some of what's discussed in the message above and in the Visio diagram.
The message was written in an earlier stage of my thinking, so some of what's described may be out of sorts with the Visio piece.
----------------------------------------------
This message describes an advanced method of page templating and layout management. It allows administrators to easily and significantly modify page layouts by modifying simple tag-based descriptions. The system also allows novice users to extensively modify layouts within editable subsections of pages and (unlike many page templating strategies) to allow users to call advanced presentational functionalities via custom tags that they can write into their content as plaintext.
Behind the scenes, the system works by "expanding" XML tag information in a succession of stages. At the highest and most abstract level, a page layout is described as a simple combination of custom XML tags embedded in a tabular HTML layout.
The contentarea +within+ a layout can be modified by a user in a given page instance. The user can opt to include custom tags that call advanced functionalities within this contentarea, using a web-based administration tool.
So, in Stage 1, the administrator can describe pages as a set of abstract tags: header, contentarea, footer, and so on. In Stage 2, the Stage 1 tags are "expanded" into a more complete layout along with feeding in database content for the contentarea of a given page instance. The contentarea corresponding to a page instance may include custom tags written in by a user via a web-based editor. In Stage 3, the user's custom tags are expanded into an HTML stream and combined with the output of Stage 1 to render a finished webpage. Succinctly:
1) XML layout description with tabular layout -> 2) Template expanded into page instance with contents of contentarea from DB -> 3) custom controls/parameters embedded in the content area expanded
This model is powerful because the conceptual view of a page is separated from the details of its rendering. The high-level description of the page remains a "pure" and uncomplicated XML description. Lower levels can contain the details of rendering, can "branch" versions to accommodate alternate browser types, etc.
In this model, both page layouts and content layouts can be managed via web-based CMS, and parameters can be fed to the tags to modify the basic conditions of the layout. If the controls that drive the page parts are sufficiently encapsulated, the layout descriptions are extremely flexible.
Unresolved issues: I may be suffering from a case of "creeping elegance" (the evil twin of "creeping featurism"), but it would be nice if you could somehow have a total separation of the XML tags that describe the template elements, and the mechanism of describing where a given element should be placed. In the model I describe above, HTML table structures are used to position the custom tags. You could conceivably use CSS to describe placement, but it still intermingles some specific presentational details with abstract layouts.
So right now, you're looking at...
<table>
<tr> <td colspan='3'> <layout:header / > </td> <tr> <td> <layout:navbar / > </td> <td> <layout:contentarea / > </td> <td> < layout:sidebar /> </td> </tr> <tr><td colspan='3'> <layout:footer /> </table>
...for a given page layout type, which is looking pretty good in terms of simplicity. But really, it would be nice if you could somehow express this in a way that's independent of HTML or CSS or any presentational technology, but could somehow notate the spatial relationships of the layout so that it could be rebuilt independent of any presentational tech.
Ideas? Is the "right" solution here just to call it a day and make templates as necessary to suit the presentational tech de jour? Or is there a better way?