On Thursday, November 14, 2019 at 9:34:49 AM UTC-8, mageykun wrote:
>
> Ooh. It's so close, but I found an edge case.
>
> If the contents of [[FavoriteTags]] are not in alphabetical order, it 
> forces them to be so in the tag display.
>

I think I've got a solution!  See if this makes sense to you:

1) Create [[ATestTiddler]], tagged with "A B Bar Baz C foo"
2) Copy-and-paste the following experiment into the body of [[ATestTiddler]]
''THIS IS THE STANDARD TAG DISPLAY:'' All tags, sorted alphabetically<br>
``<$list filter="[all[current]tags[]] +[sort[title]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>``<br>
<$list filter="[all[current]tags[]] +[sort[title]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>

''ALL FAVORITE TAGS:'' defined in text field of FavoriteTags tiddler<br>
``<$list filter="[enlist{FavoriteTags}]" template="$:/core/ui/TagTemplate" 
storyview="pop"/>``<br>
<$list filter="[enlist{FavoriteTags}]" template="$:/core/ui/TagTemplate" 
storyview="pop"/>

''FAVORITE TAGS NOT TAGGING THIS TIDDLER:''<br>
``<$list filter="[enlist{FavoriteTags}] -[all[current]tags[]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>``<br>
<$list filter="[enlist{FavoriteTags}] -[all[current]tags[]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>

''THIS IS PART ONE:'' FavoriteTags excluding those not tagging this 
tiddler<br>
``<$set name="nottagged" filter="[enlist{FavoriteTags}] 
-[all[current]tags[]]">
<$list filter="[enlist{FavoriteTags}] -[enlist<nottagged>]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>``<br>
<$set name="nottagged" filter="[enlist{FavoriteTags}] 
-[all[current]tags[]]">
<$list filter="[enlist{FavoriteTags}] -[enlist<nottagged>]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>

''THIS IS PART TWO:'' All Tags excluding FavoriteTags, sorted 
alphabetically<br>
``<$list filter="[all[current]tags[]] -[enlist{FavoriteTags}] 
+[sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>``<br>
<$list filter="[all[current]tags[]] -[enlist{FavoriteTags}] +[sort[title]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>

''THIS IS THE DESIRED RESULT:'' Part one followed by part two<br>
``<$set name="nottagged" filter="[enlist{FavoriteTags}] 
-[all[current]tags[]]">
<$list filter="[enlist{FavoriteTags}] -[enlist<nottagged>]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[current]tags[]] -[enlist{FavoriteTags}] +[sort[title]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>``<br>
<$set name="nottagged" filter="[enlist{FavoriteTags}] 
-[all[current]tags[]]">
<$list filter="[enlist{FavoriteTags}] -[enlist<nottagged>]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
<$list filter="[all[current]tags[]] -[enlist{FavoriteTags}] +[sort[title]]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
</$set>

To test:
3) Check the results shown in [[ATestTiddler]] are as expected... i.e., 
that the last experimental output is the desired tag display.

To implement:
4) Paste the final code into $:/core/ui/ViewTemplate/tags:
<$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" 
retain="yes" animate="yes">
<div class="tc-tags-wrapper">
   <$set name="nottagged" filter="[enlist{FavoriteTags}] 
-[all[current]tags[]]">
   <$list filter="[enlist{FavoriteTags}] -[enlist<nottagged>]" 
template="$:/core/ui/TagTemplate" storyview="pop"/>
   <$list filter="[all[current]tags[]] -[enlist{FavoriteTags}] 
+[sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/>
   </$set>
</div>
</$reveal>

Let me know how it goes...

-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/5cdb980a-5252-4cb9-bb8f-cd241b160174%40googlegroups.com.

Reply via email to