Return a value based on [tag] ?

102 views
Skip to first unread message

Shaw McAllan

unread,
Apr 26, 2016, 12:05:05 PM4/26/16
to TiddlyWiki
 Hey, All :)
 
Is it possible to return a specific value depending on the tags attached to tiddlers?
 
I'd like the value "Tam" to show up in a table if the tag is "T", "Kaye" if it's "K" and "Jason" if it's "J".
 
At the moment, I have this:
 
<table>
<th>Assigned</th><th>Task</th><th>Status</th>
<$list filter="[tag[J]]">
<tr><td></td><td><<currentTiddler>></td><td></td></tr>
</$list>
<$list filter="[tag[K]]">
<tr><td></td><td><<currentTiddler>></td><td></td></tr>
</$list>
</table>

I'd like the first column of the table to pull through Tam, Jason or Kaye but I have no idea as to where to start...?
 
 
Thanks for any pointers,
-S

Hegart Dmishiv

unread,
Apr 26, 2016, 12:39:37 PM4/26/16
to TiddlyWiki
Hi Shaw,

Sounds to me like you want a <$reveal> widget. Something like:

<$reveal type="match" text="T" state=!!tags>Tam</$reveal>

Hope this helps. Give the TW documentation a look over, if my example doesn't work exactly as expected.

Hegart.

Matthew Petty

unread,
Jul 25, 2016, 7:26:04 AM7/25/16
to TiddlyWiki
Using a field for the state was just what I was looking for, thanks!
Reply all
Reply to author
Forward
0 new messages