Marcio,

Yes, you are correct in this case it does not matter because the test is 
against the current tiddler and will only list the current tiddler inside 
the list, as in these two examples that have identical outputs

Read on to learn why I suggest it as a rule, otherwise ignore it.

The following are identical with or without the variable set because the 
result is only the current tiddler
<$list filter="[all[current]tag[Test]]">
Current tiddler title = {{!!title}}<br>
or <<currentTiddler>><br>
Other field value = {{!!test-field}}<br>
</$list>


<$list filter="[all[current]tag[Test]]" variable="null">
Current tiddler title = {{!!title}}<br>
or <<currentTiddler>><br>
Other field value = {{!!test-field}}<br>
</$list>

The difference comes when the filter results in more than one answer, *which 
is not your use case*

For example when two tiddlers are tagged with Test are the results, with 
this changed filter,

<$list filter="[tag[Test]]">
<h3>Tiddler {{!!title}}</h3>
"<<currentTiddler>>" is the each tiddler title
<h4>~~The calling tiddler details~~</h4>
Current tiddler title = {{!!title}}<br>
or <<currentTiddler>><br>
Other field value = {{!!test-field}}<br>
</$list>


---


<$list filter="[tag[Test]]" variable="tiddlertitle">
<h3>Tiddler <<tiddlertitle>></h3>
"<<tiddlertitle>>" is the each tiddler title
<h4>The calling tiddler details</h4>
Current tiddler title = {{!!title}}<br>
or <<currentTiddler>><br>
Other field value = {{!!test-field}}<br>
</$list>

In  the first case you no longer have simple access to the calling tiddlers 
details, they are exchanged for the filtered tiddlers (ones tagged with 
Test)

In the second case you retain the calling tiddlers values inside the list.

To access other fields in this second case you can use the view widget

<$view tiddler=<<tiddlertitle>> field="test-field"/>

However in many applications you do not need to reference the 
<<tiddlertitle>> or test-field so I add the variable, but call it null, and 
never use <<null>>
eg
<$list filter="[tag[Test]]" variable="null">
blah blah

This becomes even more important if you have nested lists multiples levels 
deep, because it allows you to continue referencing the calling tiddlers 
title and fields all the way down. Which in most cases is exactly what we 
want to do.

So as a rule I use the variable=null or another variable name if I *may* 
want access to the containing tiddlers details available inside the list 
widget or nested widgets.

And in your case it makes no difference, so no harm doing it?

<$list filter="[all[current]tag[Test]]" variable="null">
MY STUFF GOES HERE
</$list>


Rehards
Tony



On Sunday, July 1, 2018 at 6:04:50 AM UTC+10, Marcio Augusto wrote:
>
> Hi Tony,
>
> I didn't follow here. How setting *variable *helps, if the default is 
> *currentTiddler*?
>
> Regards,
> Marcio.
>
> On Friday, June 29, 2018 at 10:15:10 PM UTC-3, TonyM wrote:
>>
>> Mark,
>>
>> I would think it better to add variable="null" to the list widget since 
>> we know at best the value inside the list will be our targeted tag.
>>
>> By using a variable the stuff will remain relavant to the current tiddler 
>> such as field references etc
>>
>> Regards
>> Tony
>>
>>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/31c65657-4fe7-4db1-8592-1aa02bf495ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to