Tobias <$setvar> and TW5 <$set> interpret filters differently, returning list items that internally have square brackets. My work-around was to strip them off with the removeprefix and removesuffix filter operators before looking for tags. Please excuse that I've changed the criteria to meet my available test data:
\define predb() [[ \define postdb() ]] <$setvars _r="[tag[ToDo]!tag[Template]random[1]]" random="[r]"> <<random>> has tags -- <$list filter="[title<random>] [title<random>removeprefix<predb>removesuffix<postdb>]+[tags[]]" > <$view field="title"/> </$list> </$setvars> This seems to work and take into account titles with spaces and titles without. Hopefully. Good luck, Mark On Friday, July 7, 2017 at 5:07:30 PM UTC-7, David Sevilla wrote: > > Hi, > > I just installed tobibeer's random and setvars plugins in order to > generate a random tiddler among those with a certain tag: > > Random document: <$setvars _r="[tag[Document]!tag[Template]random[1]]" > random="\{{{\ [r] \}}}\" > > > <<random>> > </$setvars> > > So far, so good. But now I'd like to list the tags of that random tiddler, > and that's where I am stuck :) I am basically trying to get a filter like > [[<<random>>]tags[]] to work inside a widget (text, list...). My attempts: > > 1. > <$list filter="[[<<random>>]tags[]]" /> > > should give me one "ok" per tag, but it prints nothing. I don't know > why. > > 2. > <$text text=<<random>> /> > > gives me the tiddler name between {{{ }}} and, if not a simple name, > also in [[ ]]. I don't know how I could cut that string so I can feed it to > a filter (or combine strings to make one, see point 4). > > 3. Removing the triple braces in the definition of "random" does get rid > of the text's curly braces of step 2, and if the tiddler name is simple > enough there are no square brackets, but still the code of item 1 is not > finding any tags. > > 4. At step 3, and with no-square-bracket names, I did <$list > filter="[["+<<random>>+"]tags[]]"> ok </$list> obtaining a certain mess (I > guess one cannot just add strings with "+", or I don't have such strings). > > 5. Just in case there was something weird between the initial angled > bracket of the widget and the double ones of <<random>>, I substituted it > with $macrocall. Nothing useful from that one. > > Any suggestions are very welcome. > -- 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 tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/6977528f-1395-479d-9980-57dfb9aa75f7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.