\define makeOld()<$fieldmangler>Add <<tag OldTopics>> <$button message="tm-add-tag" param="OldTopics">{{$:/core/images/new-button}}</$button><br>Remove <<tag Topics>><$button message="tm-remove-tag" param="Topics">{{$:/core/images/delete-button}}</$button></$fieldmangler>\end
<<makeOld>>
\define myactions()
<$fieldmangler>
<$action-sendmessage $message="tm-add-tag" $param="OldTopics"/>
<$action-sendmessage $message="tm-remove-tag" $param="Topics"></$button>
</$fieldmangler>
\end
\define makeOld()
Add <<tag OldTopics>> Remove <<tag Topics>>
<$button actions=<<myactions>>>{{$:/core/images/erase}}
</$button>
\end
<<makeOld>>
I use the fabulous listops action for this (a bit complicated but reusable):
\define BtnTagListops(btntext,add-remove,tooltip)
<$button tooltip="""$tooltip$""">
<$wikify name="timestampState" text="{{$:/config/TimestampDisable}}">
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
<$action-listops $tags="$add-remove$" />
$btntext$
<$action-setfield $tiddler="$:/config/TimestampDisable" $value=<<timestampState>>/>
</$wikify>
</$button>
\end
This does change tags WITHOUT updating timestamps (it stores and restores the previous setting for updating timestamps). I call it from other macros like this one:
\define todoBtnDoNow()
<$wikify name="tt" text="switch tags">
<$macrocall $name="BtnTagListops" btntext="Do this now" add-remove="ToDoNow -ToDo" tooltip=<<tt>>/>
</$wikify>
\end
<<todoBtnDoNow>> adds the tag ToDoNow and removes the tag with the minus (-) ToDo. You could add and remove as many tags as you like.
These are somewhat simplified macros, I hope they still work and it is clear how they work.
Cheers,
Thomas
(Back from offline vacation.)
\define BtnTagListops(btntext,add-
remove,tooltip)
<$button tooltip="""$tooltip$""">
<$wikify name="timestampState" text="{{$:/config/TimestampDisable}}">
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
<$action-listops $tags="$add-remove$" />
$btntext$
<$action-setfield $tiddler="$:/config/TimestampDisable" $value=<<timestampState>>/>
</$wikify>
</$button>
\end
\define todoBtnDoNow()
<$wikify name="tt" text="switch tags">
<$macrocall $name="BtnTagListops
" btntext="Do this now" add-remove="ToDoNow -ToDo" tooltip=<<tt>>/>
</$wikify>
\end
BtnTagListops
" instead of teBtnTagListops.Hi folks,I use the fabulous listops action for this (a bit complicated but reusable):
\define BtnTagListops(btntext,add-remove,tooltip)
<$button tooltip="""$tooltip$""">
<$wikify name="timestampState" text="{{$:/config/TimestampDisable}}">
<$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/>
<$action-listops $tags="$add-remove$" />
$btntext$
<$action-setfield $tiddler="$:/config/TimestampDisable" $value=<<timestampState>>/>
</$wikify>
</$button>
\endThis does change tags WITHOUT updating timestamps (it stores and restores the previous setting for updating timestamps). I call it from other macros like this one:
\define todoBtnDoNow()
<$wikify name="tt" text="switch tags">
<$macrocall $name="teBtnTagListops" btntext="Do this now" add-remove="ToDoNow -ToDo" tooltip=<<tt>>/>
</$wikify>
\end