Try \define add-tiddler() <$button> <$vars lb="[[" rb="]]"> <$wikify name=tags text="tag1 <<lb>><<currentTiddler>><<rb>>"> <$action-sendmessage $message="tm-new-tiddler" title=<<now>> tags=<<tags>> /> New Tiddler </$wikify> </$vars> </$button> \end
<<add-tiddler>> On Sunday, November 24, 2019 at 3:51:22 PM UTC-8, kat wrote: > > I have created a template for a button and I'm trying to turn it into a > macro that has the option to also add <<currentTiddler>> as a tag. It's not > clear to me from the manual how to do this so I would really appreciate any > help. > > Here is a simplified example to illustrate what I mean. Say this is my > button: > > \define add-tiddler() > <$button><$action-sendmessage $message="tm-new-tiddler" title=<<now>> tags > ="tag1" /> > New Tiddler > </$button> > \end > > I'm trying to modify the macro so that <<add-tiddler tag:"false">> would > run something like this: > > <$action-sendmessage $message="tm-new-tiddler" title=<<now>> tags="tag1" > /> > > While <<add-tiddler tag:"true">> would run this: > > <$action-sendmessage $message="tm-new-tiddler" title=<<now>> tags="tag1 > [[<<currentTiddler>>]]" /> > > I'm trying to avoid creating two separate templates/macros because my > actual button code is pretty long and it will be awkward to have to edit > both every time I want to make a change. > > Thanks in advance for your help. > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/81a9be57-021d-4547-8528-88edb3ba49b0%40googlegroups.com.