On Thu, Mar 09, 2006 at 09:16:01PM -0600, Brad Anderson wrote: > Pardon my ignorance... a cs include can't have a cs:var as a value? > > http://www.clearsilver.net/docs/man_templates.hdf#include > > says you can use a string or a variable. Even more interesting is > linclude, which loads/parses at render time. "Local variables can be > used to specify the filename" > > Doesn't all of this mean that you could have a template per field type, > and just populate the main hdf with extra values specific to that field? > > I'm probably simplifying a bit too much.
Ah yes, sorry, I forgot to mention some other problems I encountered while going down this exact same path. Basically, you need some way of communicating where the ticket field data is stored in the HDF tree. There seemed to be two options for this: 1. Choose a static location, eg. "field", where the field type templates know to look. However this means you need to copy the field data into this location, render the field, copy it to its final location and finally *delete* the top-level "field". This seems fairly expensive, probably on a par with just recreating the HDF itself. If the field data is not cleared out, you get "bleeding" of values from one field to another, which is not good. 2. The other thing I tried was setting a variable with the location of the field data in the HDF tree. Unfortunately, local variables don't seem to be propagated across includes in ClearSilver. Alec -- Evolution: Taking care of those too stupid to take care of themselves. _______________________________________________ Trac-dev mailing list [email protected] http://lists.edgewall.com/mailman/listinfo/trac-dev
