Folks, With 5.3.x and the $parameters widget and $transclude widget improvements, I have finally developed a solution that allows you write a template block in a tiddler (even field), procedure/macro, or inside a widget.
- The template content can be any “tiddlywiki script” or wikitext
- Including internal pragma, import, functions procedures etc…
- You can pass into the template any parameter/value you want into that block.
- All you need to do is use the parameter name, as a variable inside your template.
- There is also the opportunity to provide a display filter to conditionally display the rendered template.
- Also access the location of the template or the procedure that enables it with custom variables.
- Turn links in the content on or off, for printing etc…
Why?
- This helps make template for multiple purposes and use them inline (bespoke) or make them reusable as a macro/procedure or tiddler.
- Easly create mail merge or reusable layouts or forms.
- Easily search for and find all template invocations using this method, regardless of the where the template is stored.
I thought before I share this solution I may present the concept and seek feedback at a high level.
- What features would you like in a generic templating feature?
- What problems have you encountered using content templates in the past?