[RFC] Alternative display of tags in view template - conditional tag display

Folks, Request for comment.

I have long thought it would be nice if the display of tags in the view template was a little smarter, so I just built a solution that allows an optional conditional display of tags.

  • Basically if the tag tiddler exists and has a field “display-filter” then this is applied before displaying the tag on the view template.

I will share this solution in this topic so do follow it if you are interested. Perhaps give me a thumbs up if interested.

Request for comment;

  • Are there any other smarts you would like to add to the “display of tags in the view template”?
  • Do you thing something like this deserves being in the core?

Examples may include

  • Sorting tags, how?
  • An optional add tags drop down for tiddlers not on the current tiddler, with their own display-filter.
  • What about an option to hide system tags on non system tiddlers?
  • What about a drop down near tags for other tag options eg on tiddlers tagged “todo” suggest the “done” tag.

If you can actively contribute to this solution, I can add most features before I publish it, and the winners may one day end up in the core, if we are lucky.

[Edited] This is a compilation of things I will include as a a result of your replies or other thoughts I have.

  • Display an icon if this tiddler is itself a tag, which is a tag dropdown, the tag dropdown can use my “reimagine tags package”.
  • Allow additional items to be added before and after the tag line itself and after each tag using tags just as we add items to the view template and viewtoolbar with tags.

I have built a Proof of concept here please review and comment.

  • Just go ahead and play with some tags on tiddlers
  • Review the packages root tiddler from the Home tiddler.

The following is possible with any tag

  • Create the tag tiddler, add a display-filter and give it a conditional filter, typically based on “all[current]” tags will only be listed if they meet the display-filter.
  • A set of tags are available to transclude content into the tags bar in different places. Current examples include
    • tagging here icon appears if the tiddler is a tag used on other tiddlers
    • You can optionally show a remove tag button on tags
    • It (optionally) displays and info icon on the tag bar to help identify you are not using the default.
  • There is an option to display an edit icon to open each element if you set it to design mode.

I may add some more examples soon.

Hi, Could you add some example tiddlers that use tags as you described it. I’m probably missing something. I have no idea, what it should do, without having to have a look at the code.

I will add some examples shortly, but perhaps a summary will help.

It allows you to set a display-filter on any “tag tiddler” to influence if it is displayed in the view template or not. In a way it allows for hidden tags, although they are visible as soon and you edit the tiddler.

You would use this if you develop a solution where you are using tags to manage and control tiddlers, but there is no need for the user to see the tag on the tiddler, because its distracting.

  • Possibly not the best example but, Lets say you provide a button to create new todo items (New tiddler with the todo tag) and the todo tag not only indicates its a todo item but it modifies the viewTemplate to look like a todo item, and perhaps some buttons appear, to mark the todo done (add the done tag).
    • Basically as soon as you make it a todo item it behaves as one, but the todo tag is hidden.
  • Now you can use tags to list todo items and include exclude ones with a done tag but without cluttering the tag bar.

To set a display-filter for any tag,

  • Click on the tag pill and select the tag name, this opens a tiddler for the tag
  • Edit the tag tiddler and add the display-filter field and provide a filter.

This has come about because I have seen numerous occasions where such a facility will provide a new and simple way to drive things with tags without “polluting the visual tag list” but it is important to consider the complementary features I am developing (below), that I can add to the view template “tag bar”. If you look closely you will see you can add content before and after the tag bar or after each tag, using special system tags.

  • For example see in the $:/PSaT/ViewTemplate-tags the checkbox, Use Show remove tag icon on each tag. This allows tags to be removed from the view Template.

Complementary features I am developing

  • Use a similar display filter to “propose tags you may want to add”, for example tiddlers with a todo tag, (and no project tags) we may provide the ability to assign a project (tag) to the tiddler, using a drop down to select from the available project tags.
  • I plan to allow something similar to be done with fields, where rather than add a tag it adds a field with a selected value.
  • I plan to introduce “action tags” which allows you to select from the tag dropdown an action that is applied to the tiddler. For example perhaps you can select from the tag dropdown am archive option which removes the todo tag and adds the archive tag.

This works well with my “reimagine tags package” which enhances the tag dropdown so I will add it now.

TW_Tones, I have found this thread with a demo link for https://alt-tags-bar.tiddlyhost.com/

But I’m not finding a demo site for reimagine-tags. There is at least one json downloadable posted here, but it’s difficult to be sure whether such a json reflects the latest revisions. (There is also at least one variant spelling floating around here on the forum — without the e — which also complicates searching for it.)

Do you have a demo site for the reimagine-tags project? I wanted to recommend it for a recent question (about note-taking) but couldn’t reconstruct a good link.

Thanks!

  • Yes Sorry, As someone not using a GitHub site, or node as a rule I have being trying to get enough info to build Plugin Libraries from inside a single file wiki. This means I have not being able to publish via a library which is ideal for managing published versions.
  • It may be deployed on one of my tiddlyhost sites but the alt-tags-bar site is as good as any.
    • I have placed a recent version there and will soon publish a new version
    • So you can rely on that wiki for the latest published version.

Looks Like I need to improve the documentation on that site, it all made sense at the time, but now I can see I need to be more verbose.

On a side note

  • searching talk.tiddlywiki.com for “reimagin tags” and opening the FIRST discussion listed, seems to find the latest mentioned and uploaded package.

Hm, couldn’t a tiddlyhost site still demo the package in its latest version, even if it’s not bundled as a plugin?

Yes, it does now.

New version and package soon.