Many tiddlers in my TiddlyWiki have a ‘related’ field. Part of my edit template looks like this:
<$list filter="[<currentTiddler>has[related]]">
<div style="column-count: 4;">
{{{ [get[related]enlist-input[]unique[]sort[]] }}}
</div>
</$list>
This produces a four column list of values appearing in ‘related’ field of all tiddlers. I, then, populate the ‘related’ field of the current tiddler by entering values manually.
But I would like to be able to click checkboxes next to these values and see them appear in the related field. So, I tried the following:
<$list filter="[<currentTiddler>has[related]]">
<$list filter="[get[related]enlist-input[]unique[]sort[]]" variable="rwords">
<$checkbox field="related" checked=<<rwords>> unchecked="" default="">
<<rwords>></$checkbox><br>
</$list>
</$list>
This means if I check a box next to ‘King’, the ‘related’ field of the current tiddler is set to ‘King’.
But I want to add ‘King’ to the existing values in ‘related’ field. And remove ‘King’ if I uncheck the box.
How do I get that behavior?
Also, this code produces a long list of values. How do I get that into four columns like my current set-up?