[tw5] Re: customize order of tag display

How would we achieve this without altering the core/ui shadow tiddler? Is there a way to make upgrades less of a nightmare and overriding the $:/core/ui/ViewTemplate/tags with our own template ? (I haven’t done any deep customization such as this before so sorry ahead of time if it’s an obvious answer.)

Also I am not sure if I am understanding Eric’s suggestion for the tag ordering in the new TagsOrder tiddler:

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.

Do we put that in a new list field within the tiddler itself, or do we put our own <$list> widget in the tiddler text body, or do we just list the tags b ?

Also I am not sure if I am understanding Eric’s suggestion for the tag ordering in the new TagsOrder tiddler:

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.

Do we put that in a new list field within the tiddler itself, or do we put our own <$list> widget in the tiddler text body, or do we just list the tags as we would in a list field, but this time in the main text body of the tiddler i.e. Topic [[New Topic]] Fiction [[Non-Fiction]] …… ?

Finally got it to work. The tiddler titled $:/config/TagsOrder (and also tagged $:/config/TagsOrder) had to have each tag incased in [[*]] notation and line separated

[[Tag]]
[[Another Tag]]
[[An Yet Another]]

I don’t know why it wouldn’t work otherwise. I wish there was a way to set tag precedence rather than have to arrange ALL tiddlers. I did appreciate Eric’s button code which pulled in all the tiddlers, though! :slight_smile:

You need the [[]] when using two or more words with spaces. [[Another Tag]]

If you did not use [[Another Tag]], you would end up with 2 tags. Another and Tag

Given the current definition of $:/core/ui/ViewTemplate/tags, I don’t see any other way to make this change without altering that shadow tiddler.

While this does add some extra steps to the upgrade process, upgrades typically only occur twice a year or so; and, when upgrading, the “status” column will indicate that you that you are overriding a shadow.
After upgrading, you can compare the modified tiddler with the default shadow using these steps:

  1. Open $:/AdvancedSearch, Filter tab and select “Overridden shadow tiddlers” from the dropdown next to the input field.
  2. Open $:/core/ui/ViewTemplate/tags from the search results and click on ‘edit’ to view the tiddler source
  3. In the editor toolbar, enable preview (the closed eye) and from the preview options dropdown (chevron-down, next to the eye), select “differences from shadow (if any)”

The preview panel will now show the differences (if any) between your modified shadow and the newly upgraded shadow (red strikethroughs for removed content, green underlines for added content).
If the only difference is the change you previously made, then you’re done.
Otherwise, you will need to delete your modified shadow and then edit the shadow again to hand-merge your changes into the upgraded shadow.

Sure, this is a bit of a hassle, but as I noted above, upgrades only occur twice a year, and most of the time, those changes are to core JS code, rather than UI definitions, so it’s probably no more than a few minutes effort.

-e

Finally got it to work. The tiddler titled $:/config/TagsOrder (and also tagged $:/config/TagsOrder) had to have each tag incased in [[*]] notation and line separated

[[Tag]]
[[Another Tag]]
[[An Yet Another]]

Notes:

  • You don’t need to tag $:/config/TagsOrder with “$:/config/TagsOrder” (unless you want to!)
  • Technically, you can enter all the tags on one line using a space-separated list. I just find that using newline makes it easier to re-order the list since you can select/cut/paste entire lines to move items around.
  • The doubled square brackets are only needed for tags that contain spaces.

…I wish there was a way to set tag precedence rather than have to arrange ALL tiddlers.

How would you go about defining the precedence, if not by listing the tags in the desired order?

I did appreciate Eric’s button code which pulled in all the tiddlers, though! :slight_smile:

You’re welcome :slight_smile:

-e