How to make the tags draggable in the tags tab?

Greetings to the TW Community.

I want my tags to follow a certain order and the only way I know how is by supplying a list of the tags in the order that I want in the filter field of the $:/core/Filters/AllTags tiddler. However, this ‘technique’ becomes unmanageable when the tags becomes too many. Is there anyway to make these tags draggable as shown by the image below?

1 Like

The reason you will find it difficult to reorder these tags is at least two reasons;

  • Tags by default, if dragged contain the list of tiddlers they tag, that is a “tag pill” can be dragged and dropped on another wiki and all the tiddlers it tags will be dropped. The drag mechanism does this not the order of tags.
  • There is no intrinsic order to the tags, this list is alphanumeric because there is perhaps no other useful way to sort them.

Perhaps this depends on why you want to do this?

Are you trying to "force an order on all users of the wiki, or just for your own convenience?

  • I have different answers to these questions if I knew your answer/

The same can be asked for this question you asked How do you hide a tag on the tag manager tab?

Are you trying to "hide tags for all users of the wiki, or just for your own convenience?

I have explored giving you a good answer and I think it best I wait for your answer!

The Wiki is for personal use (taking notes on mathematics and computer science) and there’s just one user: me. So to answer both your questions, the wiki is just for my personal convenience.

Thanks for pondering about my query.

Thanks for your answer.

So for both this question and the other I suggest cloning the existing tab and modifying them to do what you wish, you can then refer back to the original if you need to;

  • As a result you will need a modified version of @EricShulman solution for hiding tags, and I now have what I need to give you a solution to the reordering.
  • My day is ending and I am heading out this evening so not sure when I can give you an answer. perhaps someone else can help before I do.

If you use <<tag $:/tags/MoreSideBar>> you get the tag that lists the tiddlers tabs in the SideBar More tabs, and $:/core/ui/MoreSideBar/Tags is the one you want.

  • Clone $:/core/ui/MoreSideBar/Tags to a new tiddler eg “My Tag list” and change its caption as well to “My Tag list”, perhaps add the tag $:/tags/SideBar.
  • This is where we will make the changes and I expect you want both a custom order and some hidden in the same place?

An alternative to hiding some tiddlers is to instead choose which to show, and we can use this method to reorder them.

For each tag you want to include open the tag tiddler and tag that for example “selected”.

But I will have to give a full answer later.

1 Like

Yes, I do.

I’m good to whichever is the easiest to implement and which does not cause troubles that aren’t easy to troubleshoot in the long run.

Safe travels

2 Likes

I think that’s a good idea, but would be a bit more cumbersome.

Use the filter: [enlist{config/ShowTags}]
And create a tiddler named: config/ShowTags which contains the list

In your case I would not use a system-tiddler for config/ShowTags, since you will need to change it often. System tiddlers are hidden from the sidebar lists by default.


You could also create your own tab with your code if you clone this tiddler: https://tiddlywiki.com/#%24%3A%2Fcore%2Fui%2FMoreSideBar%2FTags and add your stuff there.

So you will have both tabs if you need them

@pmario, thanks for replying.

Before anything else, thank you guys for helping me. I also want you to know that I’m a noobie at tiddlywiki and I’d be grateful if the instructions are shown in a step-by-step manner, kind of like how programmers tell instructions to a computer.

Also, I’d like to rewrite and make it clear about the main ‘feature’ that I want:

  1. A clone of the tags tab, called “My Tags List” (courtesy of @TW_Tones).
  2. “My Tags List” shows all the tags except those that are excluded.
  3. A way of ordering the tags on the “My Tags List”. It can be via dragging or something else more simple.

Yes, enumerating which tags to show rather than choosing which not to show is too cumbersome, especially if you have lots of tags that you want to be shown.

Is there a way to automatically enumerate the tags except for those that I want excluded?

Can you show me your solution? I did follow your partial solution and I’m liking it. I didn’t think of cloning of the tags tab. It’s brilliant.

Try this:

  • Similar to my previous solution here: How do you hide a tag on the tag manager tab? - #2 by EricShulman
  • In $:/core/Filters/AllTags change the “filter” field from
    [tags[]!is[system]sort[title]]
    to
    [tags[]!is[system]sort[title]subfilter{$:/config/SortTags}] [tags[]!is[system]sort[title]!subfilter{$:/config/SortTags}]
  • Then, create a new tiddler named $:/config/SortTags
  • In its text field, enter a space-separated list of tags you want to sort. If a tag value contains spaces, enclose that value within doubled-square brackets.
  • The $:/config/SortTags text contents can include filter syntax. Thus, if you want to sort by any tags that start with “Chapter”, you could just enter:
    [prefix[Chapter]]
  • Note that the new $:/core/Filters/AllTags filter has two filter runs:
    • The first run selects and sorts tags in the order specified by the filter in $:/config/SortTags.
    • The second run then lists all tags not otherwise specified by the $:/config/SortTags filter (using default “by title” ascending alpha order)
  • You can combine this with my previous “hide tags” solution, by adding -[subfilter{$:/config/HideTags}] to the end of the $:/core/Filters/AllTags filter.

Thus, the complete $:/core/Filters/AllTags “sort and hide” filter should be:

[tags[]!is[system]sort[title]subfilter{$:/config/SortTags}]
[tags[]!is[system]sort[title]!subfilter{$:/config/SortTags}]
-[subfilter{$:/config/HideTags}]

enjoy,
-e

2 Likes

Alright! You’ve helped me two times already. Thanks man @EricShulman!

Yes thanks eric. I am in a different time zone and at a Doctors appointment so was delayed responding