Is there a way to prevent two tiddlers from having the same field value, like they already do with titles?
I’m experimenting with different ways to name tiddlers and one of the ways has relatively long titles, so to deal with that I made a macro that links to a tiddler with a specific fields value.
I call it! a TID (tiddler Identification data).
I think it’ll be easier to show than tell though.
\define tid(desc, tid-num:'0')
<$list filter="[tid[$tid-num$]]">
<$link>$desc$</$link>
</$list>
\end
<<tid 'Dave' 'dave#a1'>>
This is designed specifically for use with a field of ‘tid’, but if you wanted to link to a tiddler with a specific field that wasn’t tid, I took light inspiration from linkify and did that too.
\define tid(desc, tid-num:'0', field:'tid')
<$list filter="[$field$[$tid-num$]]">
<$link>$desc$</$link>
</$list>
\end
<<tid 'Davey J' 'Davey Jones' 'caption'>>
Still defaults to the tid field, but if you wanted a tiddler that has a caption of say, ‘Davey Jones’ you could do that.
I put the specific field on the end so if you wanted to use just the tid field, you wouldn’t have to do <<tid 'Dave' 'Davey Jones' 'tid'>>
you could just do <<tid 'Dave' 'Davey Jones'>>
I’ve tested what happens when two tiddlers share the same value and it makes them both appear, but no way to tell the difference between the two without hovering over them or navigating to the tiddlers in question.
so if possible, I’d like to prevent the resuse of the same value!