At present, transclusion only allows a list of parameters, which are
declared in the template as $1 to $9. I wonder if there are any plans
to (a) allow named parameters; and (b) support more than 9 parameters.
What I mean by named parameters is something like this:
"greeting" template tiddler:
hello "$name"
some other tiddler:
<<tiddler [[greeting]] name: joe>>
There are some efforts to replace jinja templating with
tiddlywiki-style templating, and likewise, I am doing some other work
with templating right now where it would make sense to use
tiddlywiki's formatter. It's not possible right now though as I would
need to use named parameters. (So I'm more interested in the library
than the macro above, per se.)
I don't think it's come up before, though it might be nice.
Having said that, it shouldn't be too hard to create a plugin (perhaps
using supplant*), which might eventually be integrated into the core.
-- F.
Very interesting Eric. It'd be neat to see you integrate that into
your patched tiddler macro.
I like the idea, but dislike the formulation and the use of the name
"data". Suggest something more explicit, such as:
<<tiddler template:MyTemplate tiddler:foo>>
but that's without thinking of the implications or if this is a
generic parameter change, or only applies to the tiddler macro.
--
Paul (psd)
http://blog.whatfettle.com