TiddlyWiki now has cascades to control rendering different parts of a tiddler and this is quite powerful.
See $:/ControlPanel → Info → Advanced → Cascades
Question
How to use this mechanism for custom transclusion?
For example, assume I want to replace the below code with cascades
<$tiddler tiddler=someTiddler>
<$transclude tiddler="myTemplate" mode="block"/>
</$tiddler>
In the proposed solution I like to have below features
- if
someTiddlerhas the fieldhide-bodyset to yes, use$:/core/ui/ViewTemplate/body/blankinstead ofmyTemplate - if
someTiddlerhas the fieldcode-bodyset to yes, use$:/core/ui/ViewTemplate/body/codeinstead ofmyTemplate - if
someTiddlerhas the fieldtemplate-bodyset tosomeTemplateusessomeTemplateinstead ofmyTemplate(e.g. user sets a custom template throughtemplate-bodyfield)
…
