Eric,
Thanks for this insight. controlling the tags list is useful.
- It does however make me ask if there were a way to use sortby so that
the "named" tiddlers were at the beginning and the balance sorted following.
The sortby or another method allows a select set of tiddlers to have their
prominence enhanced through sorting, but its not very prominent if they are
at the end of the list.
- I have used your way to define a newline variable before, thanks. But
do you know anyway to get it into a global macro?
Regards
Tones
On Monday, 14 December 2020 at 17:56:02 UTC+11 Eric Shulman wrote:
> Hi all,
>
> Recently, someone asked me if it is possible to apply a custom order to
> the tags that are displayed on a tiddler, and I came up with a one-line
> adjustment to the tags ViewTemplate that achieves this:
>
> edit the $:/core/ui/ViewTemplate/tags shadow tiddler and change this line:
> <div class="tc-tags-wrapper"><$list
> filter="[all[current]tags[]sort[title]]" template="$:/core/ui/TagTemplate"
> storyview="pop"/></div>
> to this:
> <div class="tc-tags-wrapper"><$list
> filter="[all[current]tags[]sort[title]sortby{$:/config/TagsOrder}]"
> template="$:/core/ui/TagTemplate" storyview="pop"/></div>
>
> The only change is adding "*sortby{$:/config/TagsOrder}*" to the $list
> filter.
>
> Then, you can enter tag names into $:/config/TagsOrder, and the display of
> tags in the ViewTemplate will show those tags in the order specified.
>
> Note that any tags not included in the config tiddler will be listed
> first, in the default alphanumeric order. Thus, if the config is empty or
> non-existent, the current TWCore default behavior is retained.
>
> Also, if there are a lot of tags to be listed, you can auto-generate the
> initial contents of $:/config/TagsOrder by using the following $button:
>
> <$vars lf="
> ">
> <$set name="taglist" filter="[tags[]trim[]sort[]addsuffix<lf>join[]]">
> <$button> make initial ~TagsOrder
> <$action-setfield $tiddler="$:/config/TagsOrder" text=<<taglist>> />
> </$button>
> (note that the literal newline following lf=" is important)
>
> This outputs all the current tags, one per line, into the text field of
> $:/config/TagsOrder. You can then edit the tiddler to
> add/delete/re-arrange the tags to suit your needs.
>
> enjoy,
> -e
> T
>
>
>
>
--
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/2ea413d0-ee00-47e9-94ae-7cd7ca9cd912n%40googlegroups.com.