<$macrocall $name="rememberq" id=<<currentTiddler>>
question="Q"
answer="A"
reference=<<stream-root-title>>/>
<$vars stream-root-title=<<currentTiddler>>
contextmenu-state=<<qualify "$:/state/sq-context-popup/">>
row-edit-state=<<qualify "$:/state/sq/streams/current-edit-tiddler">>
drag-title-state=<<qualify "$:/state/sq/streams/current-drag-title">>
drag-title-nextsibling-state=<<qualify "$:/state/sq/streams/current-drag-nextsibling">>
>
<div class={{{ stream-root [{$:/state/sq/nodes/global-drag-state}match[yes]then[stream-dragactive]] [<currentTiddler>!has[stream-list]then[stream-newlist]] +[join[ ]] }}}>
<$macrocall $name="stream"/>
</div>
</$vars>
\define stream()
\whitespace trim
<div class="stream-list">
<$vars dropTargetTiddler=<<currentTiddler>> >
<$list filter="[list[!!stream-list]!is[missing]]">
<$set name="enable-dnd" filter="[<enable-dnd>match[no]] ~[<drag-title-state>get[text]match<currentTiddler>then[no]]" select="0">
<<stream-row-template>>
</$set>
</$list>
<$tiddler tiddler="">
<!-- to drop after the last child of any list level-->
<$droppable actions=<<stream-drop-actions>> tag="div" enable=<<enable-dnd>> class="stream-droppable">
<div class="tc-droppable-placeholder">
</div><!-- idea only want below div with height when its a child with no more children-->
<$list filter="[<currentTiddler>!has[stream-list]]" variable="_NULL"><div class="stream-droppable-spacer"/></$list>
</$droppable>
</$tiddler>
<$list filter="[all[current]match<stream-root-title>]" variable="_NULL">
<!-- if we are the root, add a button to add more nodes-->
<div class="stream-row">
<div class="stream-node-control stream-node-control-addnew">
<div class="stream-node-collapser">
</div>
<div class="stream-node-handle-wrapper">
<$button tag="div" class="tc-btn-invisible" tooltip="add node" actions=<<add-node-actions>> >
{{$:/plugins/sq/streams/icons/new-node-btn}}
</$button>
</div>
</div>
<div class="stream-node-block">
<!--consider moving last child dropzone in here, though thats for children too-->
</div>
</div>
<$set name="currentTiddler" filter={{{[<contextmenu-state>get[current]]}}}>
{{||$:/plugins/sq/streams/contextmenu/contextmenu-template}}
</$set>
</$list>
</$vars>
</div>
\end
\define myMacro()
Reference text
\end
<$macrocall $name="rememberq" id=<<currentTiddler>>
question="Q"
answer="A"
reference=<<myMacro>>/>
Hello guys, I'm trying to recall a macro with a reference field using the following code<$macrocall $name="rememberq" id=<<currentTiddler>> question="Q" answer="A" reference=<<stream-root-title>>/>The problem is that the reference field only supports plain text and <<stream-root-title>> seems to be returning something elseHere's the declaration of <<stream-root-title>>:
<$vars stream-root-title=<<currentTiddler>> ... >
...
Is there a way I can convert the output of <<stream-root-title>> to plain text?
\define getList(tag)
<$list filter="[tag[$tag$]]"> <<currentTiddler>> </$list>
\end
<$macrocall $name="something" list=<<getList "foo">> /><$wikify name="listResults" text=<<getList "foo">> >
<$macrocall $name="something" list=<<listResults>> />
</$wikify>
\define rememberq(id, question, answer, reference: "")
<div class="rememberq">
<div class="rquestion">
<div>Q:</div>
<p>$question$</p>
</div>
<div class="ranswer">
<div>A:</div>
<p>$answer$</p>
</div>
<div class="tr-selfidentification">
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]">
<<selfid>>
</$set>
</div>
<div class="rid">
[$id$]
</div>
<div class="tr-reference">
<$text text=<<__reference__>>/>
</div>
</div>
\end
Eric thanks so much for the detailed explanation, however the macro "rememberq" doesn't seem to process the reference <<stream-root-title>> correctly.
for some reason <$text text=<<__reference__>>/> doesn't return the title I'm looking for.
<$vars stream-root-title=<<currentTiddler>>
contextmenu-state=<<qualify "$:/state/sq-context-popup/">>
row-edit-state=<<qualify "$:/state/sq/streams/current-edit-tiddler">>
drag-title-state=<<qualify "$:/state/sq/streams/current-drag-title">>
drag-title-nextsibling-state=<<qualify "$:/state/sq/streams/current-drag-nextsibling">>
>
<div class={{{ stream-root [{$:/state/sq/nodes/global-drag-state}match[yes]then[stream-dragactive]] [<currentTiddler>!has[stream-list]then[stream-newlist]] +[join[ ]] }}}>
<$macrocall $name="stream"/>
</div>
</$vars>
\define getMacro()
<$macrocall $name="rememberq" id=<<currentTiddler>>
question=""
answer=""
reference="$(nodetitle)$"/>
\end
<$set name=nodetitle
value=<<stream-root-title>> >
<$action-sendmessage
$message="tm-edit-text-operation"
$param="replace-selection"
text=<<getMacro>>
/>
</$set>
\define macroname() bla bla
Or a
<$set name=macroname filter="a filter"> etc...
<$wikify name=macroname text="<<macroname>>" output=text>
In here a filter [<macroname>match[test]] will work as expected and <<macroname>> should return a simple value, but it may be further wikified during the final render of the tiddler so if you used <$link to=<<macroname>> /> it should work.
</$wikify>
\define macroname() test
<$wikify name=macroname text="<<macroname>>" output=text>
{{{ [<macroname>match[test]then[Matches]] }}}
<$list filter="[<macroname>match[test]then[Matchesinfilter]]"><<currentTiddler>></$list>
'<$text text=<<macroname>>/>'
</$wikify>