@ Statements like "In my theme, I want to be able to control ...". Make the examples as specific as possible, and try to phrase them in terms of actual educational situations, where what you are asking to be able to do clearly makes a positive impact on the educational experience.
Tim, your question makes a real problem clear in the discussion about Moodle templates.
Nobody can seriously answer this kind of question. One major design task is to create the best possible positive impact within a certain task and context. There can't be a positive impact in general. And the solution must be different from task to task. If not design fails.
And "educational experience" does not demand a certain and specific look and feel. But the look and feel of the environment into which Moodle is integrated may demand a specific look and feel. And the presentation and form needs to be different for young learners and for adult learners.
A real life work example
Working on the moodle2 theme design I thought about how the forums may be presented to support the experience of one real discussion where people discuss together one topic. The research on forum types and looks showed up hundreds of different ways to present forum threads. For example a forum thread may be a collection of several individual expressions of personal opinions clearly separated. Or the look and organisation of the thread supports the experience of the thread as one discussion with different opinions from different persons belonging together. Two nearly opposite approaches.
I was able to realise some of the goals but I failed to implement the approach consequently. Why? The reason is that I was not able to change the content order of the relative huge personal information and repeating topic part of every posting. It separates every posting too much. If I would have access to the XHTML page structure I could have changed the content order and solve the issue.
This example shows that one can do a lot by changing the CSS. But for several essential tasks the XHTML structure needs to be changed.
Moodle theme changes with CSS are mostly like changing the wallpapers in a building. When you need a different experience you need to change the walls of the building. Multi functional buildings therefor offer "movable" walls.
Moodle is Open Source - just change core
Somebody may propose: change the Moodle forum thread content order in core when this order is better = hack Moodle core. If someone would do that the forum presentation is right for this one task but may be wrong within another context - for example when the individual posting plays the dominant role over the thread concept. So this hacking approach does not work.
Better use templates
Here templates come in handy. The program offers the content (the posting with the elements user, userimg, thread title, text etc.) in a structured way. This content is then placed into a XHTML page structure = the template. I as the web designer can rearrange the XHTML in the template and place the delivered content in the way needed for the given task. I don't hack Moodle and I don't touch content - I only arrange it to get the best user experience for the given task.
Separate content and form
The clue is to separate content and form. The program delivers structured content, the web designer delivers the XHTML form as a template and both are put together to produce the web page. It's work in two steps: First collect all content and then place it within the page. That's dead easy, isn't it?
Within Moodle the content collection and placement within the page structure is done in one go. Database calls, content preparation calculations and "echos" change evermore. Here we have the problem. Every time you want to change the form you need to change the programming too.
Separating content and form also supports two professions: (web) developers being best in handling and collecting content and (web) designers being best in creating functioning, usable and appealing web pages. Every profession can concentrate on what they can do best and co-operate in a superior user/learning experience.
In Moodle (web) developers need to deliver for both professions with very different success.
Is there any reason that CMSs and Moodle have different visualisation needs?
What I don't understand is your approach to declare information delivered with CMS systems is different in their presentation needs from information delivered by Moodle?
As you may see from my forum example above also forums and quizzes etc. never should be fixed in their visual form. You always need to see the context. And in my example the design needs to follow function and is not a candy visual effect.
The fixed form Moodle approach in the opposite is contra productive because it reduces the "positive impact on the educational experience" by reducing the impression of one closed discussion. Do you get the point?
And an important fact is, that no programmer ever will be able to create a page which fits every context. As you mentioned CMS developers solve this task by offering templates.
About templates
When I talk about templates I don't talk about template systems like for example "Smarty". I talk about XHTML include files with <?php echo $variable ?> and <?php foreach($group as $element) : ?> statements to place content within the page XHTML.
Figure out the following scenario:
In Moodle content is collected into an associative array
Import variables into the current symbol table from this array with "extract()"
Include the XHTML template saved as a separate template file "templates/forum-thread-view.inc.php"
"Echo" the variables in the symbol table within the XHTML page structure
Flush the complete page to the browser
Designers write templates to realise the needed look and feel
How may this work?
Moodle collects all template files in an array "$templates" (as a lookup table) during the setup process in "setup.php". Like Moodle collects the several CSS files now it can search the relevant places and build the table.
Every template has a unique name like "forum-thread-view.inc.php", "sideblock-list.inc.php" or "header-home-inc.php" etc. Template files are placed within "templates" directories within the blocks, modules etc. directories.
Designers can copy the template files they need to change into the "templates" directory in the "themes" directory and modify/rewrite them as needed.
Moodle reads the "templates" in the theme directory last and therefore overwrites the existing "template" entries from core in the lookup table with the new "template" link with an identical name.
Every page calls the needed "template" with for example include($templates['forum-thread-view']) and will get either the core template or the overwrite "template" written by the designer.
That's the basic templating principle many blog or CMS systems work with. I learned how those "pure PHP templating systems" work looking at Habari and Drupal.
Templates in Moodle 2.0
I will use such PHP templates in my Moodle design work in the future to provide a better positive impact on the educational experience and better integration in the visual needs for my clients.
It would be marvellous when such a simple templating system would be integrated into Moodle 2.0. Many more designers would be able to create a better learning experience with Moodle.