Hy,
I have tiddlers that contain various fields ending with the same prefix (_name). A table list all these prefix (select), 1 per line, display some related informations in differents rows, and show a “delete entry” button at the end of the line.
But these fields are spread in two categories, pre-registred entries, with fields names prefixed with “pre_” and user entry, prefixed with “user_”.
My objective is to hide the “delete entry” button if the field start with “pre_”
I have had some success with this code, as it do display the button only when the fields doesn’t have the prefix “pre_” :
<$list filter={{{ [<select>!prefix[pre_]] }}} >
<$button>
remove entry
<$action-deletefield $tiddler=<<currentTiddler>> $field=<<select>>/>
</$button>
</$list>
But one problem remain :
Some fields have spaces in their name, and in this case, the button will be displayed multiple time. For example a field name of “user_William of Orange” will list 3 fragments separated by empty spaces, and thus display the button 3 times.
I tried a few things, especially to limit the number of entries in the list with multiple filter operators (limit, first, nth), but without success.
Would you know of an other way to solve this problem of surplus buttons ?