@si looks good, well done on using <$action-confirm>, that put on a smile
on my face.
Perhaps move the action widgets to the action attribute of the button
widget, inline surrounded by triple quotes or as a macro. In general,
action widgets inside the body of a button can be buggy and should not be
relied upon.
On Friday, April 23, 2021 at 1:29:42 PM UTC+2 si wrote:
> Thanks a lot to you both!
>
> >>> Firstly note that the new filters introduced with Streams are still
> subject to change.
>
> Yep I'm just experimenting, I'll wait until the official release before
> using Streams for any actual work.
>
> >>> Secondly, the get-stream-nodes[] filter currently as includes the
> tiddler used as input in the titles it returns.
> So you may wish to trigger the code to consolidate the nodes from another
> tiddler, or change the filter expression to get all the nodes to
> [<currentTiddler>get-stream-nodes[]]
> -[<currentTiddler>]
>
> I'm actually trying to create a button to move an entire Stream into the
> parent tiddler as normal text, so I do want to include the text of the
> input tiddler in my output.
>
> This is what I ended up with in case anyone is interested:
>
> <$button>
> <$action-confirm $message="Do you wish to move this stream to a single
> tiddler?">
> <$vars lb="
>
> ">
> <$vars text={{{ [<currentTiddler>get-stream-nodes[]]
> :reduce[get[text]addprefix<lb>addprefix<accumulator>] }}}>
> <$action-setfield $tiddler=<<currentTiddler>> text=<<text>>/>
> <$action-deletetiddler $filter="[<currentTiddler>get-stream-nodes[]]
> -[<currentTiddler>]"/>
> <$action-deletefield stream-list stream-type/>
> </$vars>
> </$vars>
> </$action-confirm>
> Sqeeze this Stream into a single tiddler
> </$button>
>
> Seems to do the job, please let me know if I'm doing anything risky here!
>
> Thanks again for your help.
>
> On Friday, 23 April 2021 at 07:43:45 UTC+1 [email protected] wrote:
>
>> @si
>>
>> Firstly note that the new filters introduced with Streams are still
>> subject to change.
>>
>> Secondly, the get-stream-nodes[] filter currently as includes the
>> tiddler used as input in the titles it returns.
>> So you may wish to trigger the code to consolidate the nodes from another
>> tiddler, or change the filter expression to get all the nodes to
>> [<currentTiddler>get-stream-nodes[]]
>> -[<currentTiddler>]
>>
>> Assuming you want to combine the raw wikitext of all of the nodes, you
>> can do this:
>>
>> <$button> save nodes to a single tiddler
>> <$vars lb="
>>
>> ">
>> <$vars text={{{ [<currentTiddler>get-stream-nodes[]] -[<currentTiddler>]
>> :reduce[get[text]addprefix<lb>addprefix<accumulator>] }}}>
>> <$action-setfield $tiddler="report" text=<<text>>/>
>> </$vars>
>> </$vars>
>> </$button>
>>
>> If you want the output to be HTML, then you need to use the wikify widget.
>> Hope this helps,
>>
>> Saq
>>
>
--
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/9f510efe-cdd3-45b1-86e2-2ff68d47a5f1n%40googlegroups.com.