Tags slider/popup

55 views
Skip to first unread message

passingby

unread,
Jan 10, 2018, 2:21:47 PM1/10/18
to tiddl...@googlegroups.com
Hello friends,
I have tried to make a tags slider to help select tags to apply to current tiddler. I read documentation on tiddlywiki.com and used code from there. This code is in the tiddler named MyTaggerSlider, which is tagged as $:/tags/ViewTemplate with list-after field set to "$:/core/ui/ViewTemplate/tags". This displays the buttons show / hide on top of the template for event tiddlers.

<$list filter="[is[current]tag[event]]">
      <$reveal type="nomatch" state="!!tagslider" text="show">

            <$button set="!!tagslider" setTo="show">Show me</$button>

      </$reveal>
<$reveal type="match" state="!!tagslider" text="show">

<$button set="!!tagslider" setTo="hide">Hide me</$button>

{{||CheckboxTagger}}

</$reveal>
</$list>


And my CheckboxTagger tiddler contains this:
|!Event Category 1|<$checkbox tag="cat1/a">cat1/a</$checkbox>&nbsp;<$checkbox tag="cat1/b">cat1/b</$checkbox>&nbsp;<$checkbox tag="cat1/c">cat1/c</$checkbox>|
|!Event Category 2|<$checkbox tag="cat2/a">cat2/a</$checkbox>&nbsp;<$checkbox tag="cat2/b">cat2/b</$checkbox>&nbsp;<$checkbox tag="cat2/c">cat2/c</$checkbox>&nbsp;|

Well this system works but I am unhappy that the CheckboxTagger is hardcoded the way it is. What I am wishing for is to create a tiddlers with the name such as "cat1/a" "cat2/a" "cat3/a" etc and then tag then as "event-cat1" or create "cat2/a" "cat2/b" tiddlers (for the second category) and tag them "event-cat2". And then dynamically generate the content of CheckboxTagger, to be displayed inside MyTaggerSlider.

Can this be done?

I tried putting this in CheckboxTagger:

<$list filter="[tag[event-cat1]]">
<$checkbox tag={{!!title}}>{{!!title}}</$checkbox>
</$list> 

But this does not work as intended. The checkboxes generated are associated with the tiddlers such as cat1/a , cat1/b and remain connected with them even even CheckboxTagger is transcluded as template into MyTaggerSlider.

Any ideas? Or is there a completely different and better way to do it? 
 
Reply all
Reply to author
Forward
0 new messages