Sorry for the late reply. I had gone for sleep after posting the question yesterday night.
Thank you @EricShulman @Mohammad @TW_Tones for the replies, suggestions and solutions you have shared.
Based on the abovementioned code by Eric and Mohammed, I made some modifications as shown below to also have a pop up with tiddler list and download option - See here
<$let filter="[field-name[field-value]]">
<$button dragFilter=<<filter>> class="myfield" popup="$:/statefieldmacro">field-name:field-value
</$button>
<$reveal type="popup" state="$:/statefieldmacro">
<div class="tc-drop-down">
<$button> export
<$action-sendmessage $message="tm-download-file"
$param="$:/core/templates/exporters/JsonFile"
exportFilter=<<filter>>
filename="tiddlers.json" />
</$button>
<<list-links "[field-name[field-value]]">>
</div>
</$reveal>
</$let>
I want this to be made into a macro so that I can easily use it anywhere instead of typing the whole code everytime I need it. I don’t know how to do it correctly. I need to define the variables (field-name
and field-value
) using let widget initially I guess . Can someone guide?