On Sunday, May 29, 2016 at 2:49:13 PM UTC-7, Mark Armitage wrote:
The $checkbox widget only supports toggle of tags or field values. You can, however, achieve the effect you want, by creating a macro that uses $reveal, $button and $action-setfield (along with a little bit of HTML), like this:
\define toggleindex(tid,name,label)
<$reveal state="""$tid$##$name$""" type="nomatch" text="1">
<$button class="tc-btn-invisible"> <input type="checkbox">$label$
<$action-setfield $tiddler="""$tid$""" $index="""$name$""" $value="1"/>
</$button>
</$reveal>
<$reveal state="""$tid$##$name$""" type="match" text="1">
<$button class="tc-btn-invisible"> <input type="checkbox" checked="checked">$label$
<$action-setfield $tiddler="""$tid$""" $index="""$name$""" $value="0"/>
</$button>
</$reveal>
\end
Place the above in a tiddler (e.g., "$:/macros/tiddlytools/toggleindex"), and tag it with "$:/tags/Macro".
To use the macro, write something like:
<<toggleindex "SomeTiddler" "somename" "click here to toggle">>
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals