I’m trying to create a template for a table that transcludes the content of each tagged “$:/tags/TableRow” as a new row. Here is what it looks like:
<table>
<$list filter="[tag[$:/tags/TableRow]]" variable="listItem" >
<tr>
<td>
<$transclude $tiddler=<<listItem>>/>
</td>
</tr>
</$list>
</table>
I want to use this in a similar way to the ViewTemplate, where the TableRow tiddlers could themselves contain a list widget that is used to display them conditionally.
For example a TableRow tiddler might contain:
<$list filter="[all[current]prefix[Example:]]">
A table row to appear only on tiddlers prefixed "Example:".
</$list>
The problem is that even if the table is transcluded on a tiddler that does not match the condition [all[current]prefix[Example:]]
, a blank row gets created. I’ve tried using a filter like [tag[$:/tags/TableRow]] :filter[get[text]!is[blank]]
but this doesn’t work, because even though it might evaluate to nothing, the TableRow tiddler still has text in it.
I’m struggling to think of a pattern that will transclude a new row only if the content of the TableRow tiddler actually evaluates to something. Can anyone help?