Having begun to orient to cascades, I wonder about their power in all sorts of situations.
One is within @Mohammad’s Shiraz dynamic tables. Out of the box, the table-dynamic macro offers a tbl-expand column, which renders as a drop-down caret to peek at the tiddler’s contents (meaning its wikified text field).
I’ve discovered how I could hack the shadow tiddler in order to display something else (such as a view template that draws on various fields) when the expansion caret is toggled. The relevant shadow tiddler is
$:/plugins/kookma/shiraz/macros/dtables/tbl-expand
The key line (what shows if getindex[mode]match[edit]
is empty) is this one:
"""<$transclude tiddler=<<currentRecord>> field=text mode=block/>"""
I can replace that bit with a list widget that specifies a template. As Proof-of-Concept, I swapped in my “p-overview” template (already in action as a View Template):
emptyMessage="""<$list filter=<<currentRecord>> template="p-overview" mode=block/>"""
Of course, this brute hack affects dynamic tables throughout the wiki!
And if I try to build a filter that is responsive to more than a simple condition, I imagine the code will get messy quickly.
So, could there be a cascade solution here?
In theory, I imagine a future table-dynamic macro could include a parameter for “expand-template” (or something like that).
But one could even imagine – within the same table – a responsive tbl-expand solution that would be informed by facts about any currentRow. So it migth display code for code-body:yes tiddlers, a font-preview template for font-tagged tiddlers, etc., according to some cascade of conditions…
How far out in left field is this?
If it’s out of reach with current builds of TiddlyWiki and Shiraz, is there some other elegant way that dynamic tables could reveal different template-based tbl-expand contents for different situations?
-Springer