...is there a shorthand to only output those tiddlers with _exactly_ the one tag I'm requesting
I have 10 tiddlers tagged with both `playground` and `rust` (`[tag[rust]tag[playground]]` returns them all, but _pretend_ that I could have tiddlers with more than just two tags). In advanced search, `[field:tags[rust playground]]` returns 3 matches, and `[field:tags[playground rust]]` returns 7 matches. Meaning that Tiddlywiki knows the order that I put tags in even though they are sorted when displayed in the browser. Is there a way to return "exactly these 2 or 3 etc" tags without having to try all permutations of tags?
I tried to experiment with `[enlist{!!tags}sort[]join[,]match[playground,rust,test,two words]]` and uploaded the results. `[enlist{!!tags}sort[]join[,]]` returns the same thing as `[enlist{!!tags}sort[]join[,]match[playground,rust,test,two words]]` from my testing, so I'm not exactly sure what the match is for.
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/oT5RtR8S1Gg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f6c21926-6a5e-4c8f-870d-dc7edbe5f4f3n%40googlegroups.com.
[tag[playground]tag[rust]tag[test]tag[two words]]
On Thursday, September 23, 2021 at 6:07:22 PM UTC-4 thor...@gmail.com wrote:I just learned that list widgets can be nested; why does the above list return "the titles of the 10 tiddlers with the appropriate tags rather than printing the string "playground,rust,test,two words" 10 times, since the output of `[enlist{!!tags}sort[]join[,]match[playground,rust,test,two words]]` for a given tiddler will be either no match or "playground,rust,test,two words"?
How might I make this searching tiddler more robust in the presence of "tags with spaces", since I also use spaces to delimit tags in the `edit-text`?
Let’s say you entered “foo [[bar baz]]” (i.e., two tags, “foo” and “bar baz”).
Then, you might expect the results of the above $set widget to be “foo,bar baz”. However, because this string contains a space, the $set widget automatically encloses the output in double square brackets. Thus, the actual result is “[[foo,bar baz]]”. Then, when you use `match<tagList>` later on, it expects those square brackets to be part of the literal string match.
The solution is to use $vars with a “filtered transclusion” for the value, instead of $set, like this:
`<$vars tagList={{{ [enlist{$:/temp/tagSearch}sort[]join[,]] }}}>`
Then, tagList will be “foo,bar baz”, as you intended.
Alternatively, you can use $set, by adding “select=0” as an extra parameter, like this:
`<$set name="tagList" filter="[enlist{$:/temp/tagSearch}sort[]join[,]]" select=0>`
This tells the $set widget to only return the first list item (i.e., item #0), without adding any square brackets.