I am trying to create a button in a tiddler which adds a new tag to that tiddler. I have found a way to replace all the existing tags with the one specified, but I am having trouble getting the add-tag feature to work.
This example replaces all the tags and works.
\define mark-complete()
<$action-setfield tags="my-tag"/>
\end
<$button actions=<<mark-complete>>>Mark Complete</$button>
This example tries to just add a tag, but does not work.
\define mark-complete()
<$action-sendmessage $message="tm-add-tag" $param="my-tag"/>
\end
<$button actions=<<mark-complete>>>Mark Complete</$button>
Can someone point out what I am doing wrong? I have not used macros or widgets very extensively yet.
Thank you.
<$button>Do Eeet!!
<$action-listops $tiddler=HelloThere $field=tags $subfilter='+[append[Hello!!]]'/>
</$button>Tobias, it sounds like tm-add-tag uses the fieldmangler under the covers. Are you proposing something different? If so can you provide an example?
Thank you both!
<$fieldmangler tiddler=sometiddler>
<$button message=tm-add-tag param=SomeTag>
LOOK AT ME!! I am a button label!!
</$button>
</$fieldmangler><$button>DO EET!!
<$action-listops $field=tags $subfilter='+[append[Complete]]'/>
</$button><$fieldmangler>
<$button message=tm-add-tag param=Complete>Add The Thing
</$button>
</$fieldmangler>This is great, thank you Jed. Can I take this one step further?
I have now created a tiddler and marked it as a Macro.
\define mark-complete()
<$action-listops $field=tags $subfilter='+[append[Complete]]'/>
\end
Then in my task tiddlers I can just add a button which calls that Macro:
<$button actions=<<mark-complete>>>Mark Complete</$button>
Is there any clever way of easily creating new tasks without having to remember to type that in each time? Creative solutions are fine. Maybe that means a button in the sidebar that somehow generates a new tiddler? Maybe there is some way to use templates that I haven’t thought of? Just wondering what a TiddlyWiki expert might be able to think of.
Is there any clever way of easily creating new tasks without having to remember to type that in each time? Creative solutions are fine. Maybe that means a button in the sidebar that somehow generates a new tiddler? Maybe there is some way to use templates that I haven’t thought of? Just wondering what a TiddlyWiki expert might be able to think of.