In the previous filter examples it is more readable to use [tags[]] which
is equivalent to [enlist(!!tags}]
{{{ todo project :intersection[tags[]] +[limit[1]] }}}
Tones
On Wednesday, 14 July 2021 at 18:09:51 UTC+10 TW Tones wrote:
> Ok, the writers block has passed. Here I use the intersection filter run
> prefix available 5.1.23+
> *Perhaps you still have a more elegant solution?*
>
> Here I test and illustrate the filters using the transclude filter format,
> but they could be used in a list widget filter.
>
> Provide a list of named tags and test those that intersect with the set of
> titles in the tags field. Limit the output to one, so if used in a list
> widget the content is displayed only once if either match
> {{{ todo project :intersection[enlist{!!tags}] +[limit[1]] }}}
>
> Here I obtain the set of tags from a a text reference but it could equally
> be a variable.
> {{{ [enlist{smart-filter!!tag-list}] :intersection[enlist{!!tags}]
> +[limit[1]] }}}
>
> Here rather than use the limit[1] I have done this so the count of matches
> is passed through, and to avoid 0 matches being passed through use !match[0]
> {{{ [enlist{smart-filter!!tag-list}] :intersection[enlist{!!tags}]
> +[count[]!match[0]] }}}
>
> *Did you do this before the intersection prefix was available?*
> This example I believe illustrates the differences with the introduction
> of the intersection as documented her
> <https://tiddlywiki.com/#Filter%20Run%20Prefix%20(Examples)>e
>
> Regards
> Tones
> On Wednesday, 14 July 2021 at 17:31:55 UTC+10 TW Tones wrote:
>
>> Folks,
>>
>> I am not sure its it is a form of writer's block but I have this filter
>> in a list on the view template which detects if the current tiddler has the
>> either of the tags todo or project and displays the content "once" if it
>> has one or both of the tags.
>>
>> [all[current]tag[todo]] [all[current]tag[project]] +[limit[1]]
>>
>> However it seems to me there should be a way to provide a list of tags
>> and have a test that determines if the currentTiddler has anyone of these.
>> In some ways the reverse of the above. This would make it easier to simply
>> name another tag if needed without repeating the "[all[current]" part of
>> the filter.
>>
>> Yet, for some reason I can wrap my head around a suitable filter, thus I
>> am posting here to see if anyone can present a more elegant filter possibly
>> of the form;
>>
>> todo project othertag *something*.
>>
>> Thanks in advance
>> Tones
>>
>>
>>
--
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/079f12cd-0c2d-4fc8-8f97-4b91032f5312n%40googlegroups.com.