Code Patterns: A Tag Selector Gadget

163 views
Skip to first unread message

Charlie Veniot

unread,
Jul 14, 2021, 10:48:24 AM7/14/21
to TiddlyWiki
Hello,

(Attached JSON package with necessary tiddlers below.  Drag and drop into a TEST TiddlyWiki to try it out and experiment with.)

I've been monitoring the How to make a more convenient method for selecting tags?, and I suddenly had a coding itch I had to scratch.  So an hour later, a very bare-bones foundation for potential snazzy GUI for editing/selecting a tiddler's tags .

Fun TiddlyWiki things in this gadget:
  • setup of custom buttons for tiddler "View Toolbar"
    • mechanism, I think, is the same for setting up a buttons for tiddler "Edit Toolbar"
  • CSS for presenting a list as multicol, number of columns based on width of display area
  • a use-case for TiddlyWiki modals
  • filter example: how to get all tags in a TiddlyWiki
  • the quick and easy use of checkbox widget for selecting/unselecting tags for a tiddler
Cheers !


TagSelectorGadget.json

Mike Andyl

unread,
Jul 14, 2021, 6:51:03 PM7/14/21
to TiddlyWiki
Very good! We need to test it. But for the button it is better to use the standard code for checking the text and icon options, otherwise it looks very strange so far!

<$button tooltip="" aria-label="" class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
{{$:/my/images/storyview-classic}}
</$list>
<$list filter="[<tv-config-toolbar-text>match[yes]]">
<span class="tc-btn-text"><$text text="" /></span>
</$list>
<$action-sendmessage $message="tm-new-tiddler"
</$button>
среда, 14 июля 2021 г. в 17:48:24 UTC+3, cj.v...@gmail.com:

Charlie Veniot

unread,
Jul 14, 2021, 6:57:53 PM7/14/21
to TiddlyWiki
Yeah, I never make pretty until general concept is iron-clad, and only if it is worth it (i.e. if nobody likes the general approach, why would I waste my time with prettiness?  I'm quirky that way ...)

TW Tones

unread,
Jul 14, 2021, 9:02:05 PM7/14/21
to TiddlyWiki
Charlie,

I like the idea here. To me however the strength would be in providing a filter to the tag selection. Perhaps have a set. for example if tagged todo provide a drop down of status tags.

This would simplify wiki with a lot of tags as discussed here

I tested you JSON on tiddlywiki.com and the multi-colum effect was not there

Thanks for sharing (code rather than images).
Tones

Charlie Veniot

unread,
Jul 14, 2021, 9:21:31 PM7/14/21
to TiddlyWiki
Before posting, I tested the JSON package at tiddlywiki.com, as per screenshot below.  (Checking tags on the HelloThere tiddler.)

I use the Chrome web browser.  Which browser do you use ?

Screenshot 2021-07-14 10.19.06 PM.png

Charlie Veniot

unread,
Jul 14, 2021, 10:10:06 PM7/14/21
to TiddlyWiki
Well, choice of filtering mechanism to reduce the number tags, that's kind of hard to setup in a way that suits everybody.

Probably best to let each individual customize this basic code with the kind of filters (cosmetics, etc.) that work for her/him.

I did the parts that were fun to do on my free time.  The rest is for somebody else, although I'll build anything for anybody for the right price...

Aside:  Sharing code as attachments versus images (usually with a link to working code in hosted TiddlyWiki) is hit and miss with me.  I wish you had not brought attention to it.  It is a bit of a reminder about a standard that I don't always have the energy to achieve.  A simple "Thanks for sharing" (minus the other bit) would have been pretty sweet.



On Wednesday, July 14, 2021 at 10:02:05 PM UTC-3 TW Tones wrote:

TW Tones

unread,
Jul 15, 2021, 4:31:13 AM7/15/21
to TiddlyWiki
Charlie,

I like your large tag selector, and see similar smaller ones filtered or from a separate list would be more than enough. Yes this customisation is person and wiki specific.

Sorry about that little comment. But as much as I don't want to cause trouble, I wanted you to know I relay appreciate your work when its more accessible, In line rather than attached is just as good. I actually find the image attachment more work myself. But whatever you want. :)

Tones

Mike Andyl

unread,
Jul 16, 2021, 9:58:05 AM7/16/21
to TiddlyWiki
cj.v...
How did you export the required tiddlers in one file?

четверг, 15 июля 2021 г. в 11:31:13 UTC+3, TW Tones:

Charlie Veniot

unread,
Jul 16, 2021, 10:25:28 AM7/16/21
to TiddlyWiki
G'day Mike,

That little bit of magic really is the result of some fine teaching by Mohammad and Tones.

With advanced search in TiddlyWiki, use a filter that lists all related tiddlers (ie that work together to provide some feature/functionality/information/etc.).

Then use the export button on the advanced search tiddler to export all tiddlers found by the filter to a handy-dandy JSON file that has all the tiddlers packaged up neatly.  That one file can then be dragged for import into some other TiddlyWiki, and all tiddlers in that JSON file get "extracted".

In my mind: Very cool for simple things that don't really need all of the oomph/heft of a plugin.

Screenshot below.  (The export button is the one between the X and the garbage can.)

Cheers !

Screenshot 2021-07-16 11.20.23 AM - Display 1.png
Reply all
Reply to author
Forward
Message has been deleted
0 new messages