[TW5] $checkbox How to add tag to many tiddlers from the list?

214 views
Skip to first unread message

sini-Kit

unread,
May 5, 2015, 3:55:28 PM5/5/15
to tiddl...@googlegroups.com
hi! I have a simple <$checkbox tag="done">Is it done?</$checkbox> , but I want to add tag "done"  to many tiddlers from the list [nazvanie[test]]  how can I do it?

Jed Carty

unread,
May 5, 2015, 4:57:29 PM5/5/15
to tiddl...@googlegroups.com
At the moment you can't do it directly. I am working on letting widgets other than the button widget trigger action widgets, which is what would be needed here. So, as always, when something is impossible, cheat.
What you can do is to make a fake checkbox that is actually a button that toggles between adding or removing the tag from a list of tiddlers.

To get it to look like the normal checkbox requires something I don't feel like figuring out at the moment, so that part is up to you, but the actual functional part is done like this:

<$reveal type='nomatch' state='$:/state/someuniquenameforthisstuff' text='checked'>
☐ <$button class='tc-btn-invisible'>Is it done?
<$list filter='[nazvanie[test]]'>
<$fieldmangler tiddler=<<currentTiddler>>>
<$action-sendmessage $message='tm-add-tag' $param=done/>
</$fieldmangler>
</$list>
<$action-setfield $tiddler='$:/state/someuniquenameforthisstuff' text=checked/>
</$button>
</$reveal>
<$reveal type='match' state='$:/state/someuniquenameforthisstuff' text='checked'>
☑ <$button class='tc-btn-invisible'>Is it done?
<$list filter='[nazvanie[test]]'>
<$fieldmangler tiddler=<<currentTiddler>>>
<$action-sendmessage $message='tm-remove-tag' $param=done/>
</$fieldmangler>
</$list>
<$action-setfield $tiddler='$:/state/someuniquenameforthisstuff' text=unchecked/>
</$button>
</$reveal>

Eric Shulman

unread,
May 5, 2015, 5:08:05 PM5/5/15
to tiddl...@googlegroups.com
On Tuesday, May 5, 2015 at 1:57:29 PM UTC-7, Jed Carty wrote:
To get it to look like the normal checkbox requires something I don't feel like figuring out at the moment...

You can use simple HTML to render checkboxes, like this:
<input type="checkbox">
<input type="checkbox" checked="true">

Of course, these checkboxes are not hooked up to anything, so they are just for looks... which is just want you want.  You also want to put the checkboxes *inside* the <$button> widget, so that clicking on them falls through to the button for handling.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

sini-Kit

unread,
Jun 14, 2015, 5:20:11 AM6/14/15
to tiddl...@googlegroups.com
Thank you! it works on http://tiddlywiki.com/ but it don't want to work on my TW 5.1.5 http://novye-podarki.ru/heeg.html
is it a new feature  of TW5 ?

вторник, 5 мая 2015 г., 23:57:29 UTC+3 пользователь Jed Carty написал:

Jed Carty

unread,
Jun 14, 2015, 12:59:04 PM6/14/15
to tiddl...@googlegroups.com
Being able to put action widgets inside lists inside buttons is new in version 5.1.8 so you need to upgrade the other wiki for this solution to work.
Reply all
Reply to author
Forward
0 new messages