@Gustav
That was the closest I could get this, but as my post mentions, I would prefer avoiding sql aliases and let the developer decide what to pass to the template. The reasoning for this is that I may have a query saved in an xql that I use in multiple locations. Requiring my query to provide aliases takes away from flexibility. Maybe my logic behind is flawed, and if that is the case please enlighten me.
@Brian
I read the templating documentation on the Include tag pretty thoroughly, but I'm still having trouble double dereferencing.
The example code I posted is actually exactly all I needed. If there backslashes I'm supposed to put in the right place, I haven't figured out where to put them.
I haven't looked at the template::widget procs, but I'm essentially writing my own widgets, base widgets upon which I can build page-specific elements with other libraries. For example, my SELECT component can later go into another template that eventually transforms the SELECT to a jQueryUI element.
I was hoping to avoid building everything in TCL, as it seems to get messy pretty quickly, although I understand that to be merely an opinion. Maybe my approach is wrong altogether?