Whats happening here?

113 views
Skip to first unread message

passingby

unread,
May 14, 2019, 12:16:14 AM5/14/19
to TiddlyWiki
<$list filter="ABC DEF GHI JKL">


<
<currentTiddler>>
</$list>

This produces the result as this:

ABC

DEF

GHI

JKL


Why is this so? AFAIK filter contains names of potential tiddlers and the variable currentTiddler would take up a value when there is a match. When there are no tiddlers to match, why should currentTiddler variable take up those values?


Mark S.

unread,
May 14, 2019, 12:22:54 AM5/14/19
to TiddlyWiki
Although the attribute is called "filter", some filter operators can generate entries (titles). The titles will be generated even if there is no existing tiddler with that name. This turns out to be very useful in many situations. 

passingby

unread,
May 14, 2019, 8:56:33 AM5/14/19
to TiddlyWiki


On Monday, May 13, 2019 at 9:22:54 PM UTC-7, Mark S. wrote:
Although the attribute is called "filter", some filter operators can generate entries (titles). The titles will be generated even if there is no existing tiddler with that name. This turns out to be very useful in many situations. 

This certainly would be helpful in some cases. 



TonyM

unread,
May 14, 2019, 9:30:34 AM5/14/19
to TiddlyWiki
Of course if you use the list widgets variable=variablname it will be that rather than current Tiddler. Current tiddler is just the helpful default variable name as well as letting everything inside the list refer just to the current tiddler. For each title that results from the filter.

Regards
Tony

Mat

unread,
May 14, 2019, 12:23:52 PM5/14/19
to TiddlyWiki

Why is this so? AFAIK filter contains names of potential tiddlers and the variable currentTiddler would take up a value when there is a match. When there are no tiddlers to match, why should currentTiddler variable take up those values?


Maybe your question is on a deeper level than I understand it but if not then;

A list of titles or strings work as constructors when in a filter so currentTiddler really refers to the current tiddler title which is the item for the current list loop iteration.  

<:-)

passingby

unread,
May 15, 2019, 2:18:57 PM5/15/19
to TiddlyWiki


On Tuesday, May 14, 2019 at 9:23:52 AM UTC-7, Mat wrote:

Maybe your question is on a deeper level than I understand it but if not then;

A list of titles or strings work as constructors when in a filter so currentTiddler really refers to the current tiddler title which is the item for the current list loop iteration.  

<:-)

Well I did want to understand what was happening at the actual javascript level. I was wondering is the currentTiddler serving as the iteration counter variable like we have in a FOR loop where we do something like :
  
for (i = 0; i < 10; i++) { 
  if(i==5){
     //do something here
  }
}

Reply all
Reply to author
Forward
0 new messages