Hey,
I have given a spin at creating my first template. It really seems quite simple and I have used my favourite templating engine, namely patTemplate. After some effort, the results show up quite nicely. However, I have found that functions such as theme_blocks("all", $this);
are quite inflexible because they print their content instead of returning it and letting the theme developer decide what to do.
Now I am forced to split up my templates in many unrelated segments like:
footer() {
printSubTemplateFooter1;
theme_blocks("all", $this);
printSubTemplateFooter2;
}
Where I could be trivially doing:
footer() {
$t = theme_blocks("all", $this);
assignValueToTemplateVariable($t);
printWholeFooterTemplate;
I have checked all the obvious routes (FAQ, etc.) and I recall seeing some discussion but my knowledge of past implementation is nil. Looking at the calls under 'theme_blocks', the code itself seems pretty unremarkable, hidden in there is a single offending 'print' that does all the damage.
I suppose there might be some good reasons for taking this approach, but I think that -for example- using an optional flag parameter in the block printing routines would provide a great deal of flexibility at minimum cost. Splitting up templates might be a natural for me but my graphic designers will be surely pained. Is there anything I have overlooked?