I think this may be a solution
\define applyTag()
<!-- first remove tag -->
<$list filter="[search:title[exmp65/data]tag[exmp65]]">
<$fieldmangler>
<$action-sendmessage $message="tm-remove-tag" $param="exmp65"/>
</$fieldmangler>
</$list>
<!-- then add tag -->
<$tiddler tiddler={{exmp65/state}}>
<$fieldmangler>
<$action-sendmessage $message="tm-add-tag" $param="exmp65"/>
</$fieldmangler>
</$list>
</$tiddler>
\end
;How swith a tag among a set of tiddlers? Only one tiddler can have the tag
at a time!
: The solution is to use `select` widget and an action macro
The below example demonstrate how to switch a tag among set of tiddlers.
The code has two parts
# select widget to choose one tiddler among set of tiddlers
# action macro to set tag to the selected tiddler and remove it from
previous tiddler
Here for this example, tag `exmp65` between three tiddlers is switched.
Only one tiddler has the tag at a time. The action macro called `applyTag`.
<$macrocall $name="wikitext-example-without-html"
src="""<$select
tooltip="select a tiddler"
tiddler="exmp65/state"
field="text"
actions=<<applyTag>>
>
<$list filter="[search:title[exmp65/data]]" variable="tid">
<option value=<<tid>> > <<tid>> </option>
</$list>
</$select>
"""/>
This may be not optimized code but work!
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/26f6a0ff-a135-4f43-aef1-bf18b93bb21d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.