How to transclude tiddler field in macro call

163 views
Skip to first unread message

vpl

unread,
Nov 26, 2020, 4:51:34 PM11/26/20
to TiddlyWiki
Hi

I've developed a small macro in javascript (called TLFilter see below) and I want to pass it values stored into the tiddler fields like this

\define my-actions()
<$action-setfield $field="stampId"  $value=<<TLfilter {{!!window}} {{!!period}} "[tag[test-2]sort[date]]">> />
\end
<$button actions=<<my-actions>>>Click me!</$button>

When I call <<my-actions>> macro the text {{!!window}} and {{!!period}} is passed to it and unfortunately not the content of the window and period field of the current tiddler ... As if the window and period variables where not transcluded during the TLfilter call

How to make that running ... I struggle and cannot find a solution


Thanks in advance for your help

With regards

Regards

Mark S.

unread,
Nov 26, 2020, 5:18:03 PM11/26/20
to TiddlyWiki
AFAIK, you can't pass values to a <<macro>> that way. You have to use the macrocall widget. Then, to get the result of that call into a single variable, you'll need the wikify widget.

I couldn't test, because I don't have your macro. In the following, I guessed that your macro parameters were w, p, and f. Change appropriately. Also, be sure to have a backup:

\define my-actions()
<$wikify name=myval text="""<$macrocall $name=TLfilter w={{!!window}} p={{!!period}} f='[tag[test-2]sort[date]]'/>""" >
<$action-setfield $field="stampId" $value=<<myval>> />
</$wikify>
\end

vpl

unread,
Nov 27, 2020, 4:47:44 AM11/27/20
to TiddlyWiki
Wonderful !! Thanks a lot

Vpl

Reply all
Reply to author
Forward
0 new messages