append to list field of a tiddler and count them

121 views
Skip to first unread message

Mohammad

unread,
Dec 14, 2018, 3:21:23 AM12/14/18
to tiddl...@googlegroups.com
Question

I have some list widgets used in different part of my wikis, list some tiddlers based on different criterias, I wish to append the results to a list field of a state tiddler to be used later.

  • Pseudo code
<$list filter="[tag[myTag1]]">
 add results to list field of my state tiddler called $:/state/reference
</$list>



and again somewhere else I have, and this may happen several times

<$list filter="[tag[myTag2]]">
 add results to list field of my state tiddler called $:/state/reference
</$list>

  • Question

Later on I wish to use the  $:/state/reference to count number of references and display them as an ordered list. How can I do this?

In other words: How can I append items to list field of a tiddler (state)?

If there is another solution, I appreciate to have your opinion on that!


-- Mohammad

bimlas

unread,
Dec 14, 2018, 8:36:38 AM12/14/18
to TiddlyWiki
I don't know the exact answer, but I think you have to use `set` widget:

<$set name="output" filter="[tag[Filter Operators]first[5]]">

Text of variable: <$text text=<
<output>>/>

List of titles: <$macrocall $name="list-links" filter=<
<output>>/>

</$set>

Mark S.

unread,
Dec 14, 2018, 9:35:14 AM12/14/18
to TiddlyWiki
You probably want the ActionListopsWidget. Possibly like this:

<$button>
<$action-listops $tiddler="
$:/state/reference" $subfilter="[tag[myTag1]]"/>
Populate list field of state reference
</$button>
<$button>


Good luck
-- Mark

Mohammad

unread,
Dec 14, 2018, 12:20:04 PM12/14/18
to TiddlyWiki
Thank you bimlas, Thanks Mark.

It seems I have to put this inside button.


--Mohammad

Mohammad

unread,
Dec 14, 2018, 12:24:18 PM12/14/18
to TiddlyWiki
Mark, is it possible to not use of button? For example can I put it inside a list widget or set widget or like that?

Mark S.

unread,
Dec 14, 2018, 12:25:25 PM12/14/18
to TiddlyWiki
All actions that actually change something (not just display/render) such as tiddler fields have to go inside a button or other action widget (select, radio ... what else?).

-- Mark

Mohammad

unread,
Dec 14, 2018, 12:37:45 PM12/14/18
to TiddlyWiki
Thank you Mark!
 So I need to wrap the code inside some triggering widgets.


Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages