I've sent this email to Template-Toolkit mailing list... but there doesn't
seem to be anyone, so I'm sending it here ...
Um, you did send it at 6:30PM on a Sunday (yesterday). Support on that list
is really good, but you can't expect everyone to be on the same schedule as
you.
How can in the parent template distinguish between these two cases
(if
scalar place it, if file include it ).
You could handle this with a plugin. The plugin would determine what kind
of thing $stuff is, and then call the appropriate TT methods to handle it.
In your template you say something like:
[% MY_INCLUDE $stuff %]
I need a way to replace the web-designer
inputs,select boxes, textareas with thouse generated from me, but also
want
to preserve the formating/styles etc.. f.e.
There are basically two ways people do this. One is to replace the standard
HTML elements with your own, e.g. select size=10 name=foo becomes [%
form.select(size = 10, name = foo) %]. The other is to post-process the
resulting HTML with something like HTML::FillInForm. That could be done
inside a FILTER block. If the first appeals to you more, but you don't want
your designers to have to think about it, you could pre-process the
templates to translate the form elements to TT syntax.
There's plenty of documentation for this module that covers the details of
plugins and filters.
- Perrin