On Friday, April 24, 2020 at 9:53:26 AM UTC-7, David wrote:
>
> This variable worked fine when the listWidget loop was looping over a text
> string of gathered contexts. But the filter has been changed to loop over
> tags now. Apparently that macro style syntax (i.e. <<thisContext>> )
> doesn't quite work the same way now that the iterator is a tag. Notice
> also that the variable works in the Button Display Text area, so we knot
> the variable is representing the right thing and is present at that point
> in the code.
> <$button>
> <$action-sendmessage $message="tm-new-tiddler"
> title="Task"
> tags="Task <<thisContext>>"
> priority="3"
> />
> New Task for <<thisContext>>
> </$button>
>
>
You can't combine literal text and a variable reference *inside* of a
quoted widget parameter. Instead, you should define a macro to combine the
values, and then refer to that macro as the parameter value, like this:
\define newTags() Task $(thisContext)$
<$button>
<$action-sendmessage $message="tm-new-tiddler"
title="Task"
tags=<<newTags>>
priority="3"
/>
New Task for <<thisContext>>
</$button>
Alternatively, you can use an "inline filter" to construct the tags
parameter value, like this:
<$button>
<$action-sendmessage $message="tm-new-tiddler"
title="Task"
tags={{{ [[Task ]] +[addsuffix<thisContext>] }}}
priority="3"
/>
New Task for <<thisContext>>
</$button>
This avoids the need to define a separate macro to construct the string.
Note that the "[[Task ]]" syntax has a trailing space inside the brackets.
This is important since the value is supposed to be a *space-separated*
list of tags.
Let me know how it goes...
enjoy,
-e
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/fdd96764-9369-4967-9974-113c47ffe07d%40googlegroups.com.