On Wednesday, November 13, 2019 at 6:47:12 AM UTC-8, mageykun wrote:
>
> As far as I can tell, the main issue here is
>
> filter="[all[current]tags[]] +[enlist{MyTagOrder}]"
> DOESN'T return "all current tags that also appear in MyTagOrder" as one
> might expect (it always returns the contents of MyTagOrder).
>
> BUT
> filter="[all[current]tags[]] -[enlist{MyTagOrder}]"
> does return "all current tags, discounting those that appear in
> MyTagOrder", as one would expect.
>
> So then could the solution could become to run
>
> <$list filter="[all[current]tags[]] -[enlist{MyTagOrder}] />
> and then save this list to a variable instead of printing the output. Then
>
> <$list filter="[all[current]tags[]] -[enlist<VARIABLENAME>]"
> template="$:/core/ui/TagTemplate" storyview="pop"/>
> which should return all current tags, minus those in the variable, and the
> variable contains all current tags minus those in MyTagOrder.
>
> And so instead of relying on the combination of the + operator and
> enlist[] filter, we rely on the - operator twice. (Of course, I have no
> idea if one can use variables and lists this way!)
>
I'm VERY impressed with your logical thinking!
Change $:/core/ui/ViewTemplate/tags like this:
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div"
retain="yes" animate="yes">
<div class="tc-tags-wrapper">
<$set name="OtherTags" filter="[all[current]tags[]]
-[enlist{FavoriteTags}]">
<$list filter="[all[current]tags[]] -[enlist<OtherTags>] +[reverse[]]"
template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[current]tags[]] -[enlist{FavoriteTags}]
+[sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>
</div>
</$reveal>
Then, as before, create [[FavoriteTags]], containing:
foo bar D
and, to test, create [[ATestTiddler]], tagged with:
A B C foo bar baz
This time, it works as desired, with the resulting tag display for
[[ATestTiddler]] showing:
foo bar A B baz C
and *without* showing your favorite tags on ALL other tiddlers.
Notes:
* You need to use +[reverse[]] in the first $list filter because "
[all[current]tags[]]" *dominantly appends* the listed tags, one at a time,
which implicitly reverses the order you specify... the +[reverse[]] puts
them back in the right order.
* I added "D" to the FavoriteTags, just to be sure that it does NOT appear
anywhere (since nothing is actually tagged with "D")
Of course, I only did this one quick test and I just woke up a little while
ago, so I may have missed some odd fringe case (but I don't think so).
Give this a try on your tiddlers, and let me know if anything comes out
wrong!
enjoy,
-e
--
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/5b35d66e-2c20-4c0c-b902-056f4281d44e%40googlegroups.com.