Presenting: Tids-to-Table ~ generate tables from filters

Ah, this is the native behaviour of TW: you need an empty row before the transcluded content in order to render it as a block. In other words, it should look like this:

Sure, do what you want (just, please, share it with the community and, please, if someone else wants to modify it then also let them do so :wink: )

1 Like

One tiny question that arises while changing this to params: what are the “tid” and “fld” used for in the macro.

(OK, it’s not like I remember what the heck I did but, sure :wink: ) So, in reviewing my code without going too deeply into the weeds, I’d explain it like so:

First, for the generated output table, tid and fld are defined as:

	tid={{{  [<tiddler>get[table-$ID$-row]]
		+[trim[]!is[blank]then<tiddler>]
		... }}}
	fld={{{  [<tiddler>get[table-$ID$-row]]
		+[trim[]!is[blank]then[table-$ID$-row]]
		... }}}

i.e if the tiddler (likely the current one) has a locally defined “row template” field, then use this. You can see and example of this being used in “Demo 5/6 - Row index”. This is in contrast to using a predefined row template.

…and then…

<!-- TABLE ROWS -->
<$list filter="""[subfilter<newlist>]""" ...  >
<$droppable ... >
	<$draggable ...  tag="tr" >
		<$transclude tiddler=<<tid>> field=<<fld>> />
	</$draggable>
</$droppable>
</$list>

…this is the transclusion of that row template to create the table row. If I understand right, it is the draggablewidget that wraps it in <tr>...</tr>

1 Like