Filtering tags by name

106 views
Skip to first unread message

Ruslan Popov

unread,
Nov 4, 2019, 6:35:10 AM11/4/19
to TiddlyWiki
Hello, a newbie question.

I would like to display a list of tags in a tiddler which match a certain name pattern, for example all tags which contain the word "done", or exclude certain tags by name.I am trying this:

{{{ [all[current]tags[done]] ||$:/core/ui/TagTemplate}}}

but it still displays all tags; and this:

{{{ [all[current]tags[] + match[done]] }}}

but it displays nothing.

According to documentation, the "tags" operator doesn't have parameters. Yet in some examples I see it used like [tags[something]] - does it mean parameters are passed to it?

Thank you

Michael Wiktowy

unread,
Nov 4, 2019, 10:12:00 AM11/4/19
to TiddlyWiki
Try [all[current]tags[]regexp[done]].

You can do complex filtering with regexp but the syntax can get complex too.

/Mike

A Gloom

unread,
Nov 4, 2019, 6:51:49 PM11/4/19
to TiddlyWiki
Hello Ruslan

According to documentation, the "tags" operator doesn't have parameters. Yet in some examples I see it used like [tags[something]] - does it mean parameters are passed to it?

the documentation says the tags operator doesn't take a parameter (tags[] also like with fields[]), they're like global/wildcard selectors the [] acts as the select all

these are different from tag[] or field[] *(the difference being the suffix "s" thats how I remember their difference)
-- which allow a parameter to be used, ie tag[Contents]

I couldn't find any examples using tags[_a_value_]

exiperimenting with Advanced Search, filter tab, anything I use with tags still produces all tags so I assume any value is ignored

this will help you along with the offficial documentation when it comes to filters

from Tobias Beer at http://tobibeer.github.io/tw/filters

62 pages (tagged Filters (32), Filter Examples (28))



Ruslan Popov

unread,
Nov 5, 2019, 1:02:36 AM11/5/19
to TiddlyWiki
This is very good, and works perfectly! Regexp is what I use a lot outside of TW, and was looking for ways to use it in TW.

Thank you

Ruslan Popov

unread,
Nov 5, 2019, 1:07:39 AM11/5/19
to TiddlyWiki
Thank you Michael! Another difference seems to be that tag[] returns tiddlers, whereas tags[] does return tag names.

So if I do [all[current]tags[]] I get current tiddler's tag names, whereas [all[current]tag[done]] returns the current tiddler itself (assuming it has a tag done].


Reply all
Reply to author
Forward
0 new messages