Starting with the example Help - with basic $checkbox options - #6 by TW_Tones about tags, I’ve studied the toggle and cycle operator and I’ve written the following macros:
\define toggle-field(fld:"""myfield""" value:"""[on],[off],[----]""" label:"""""" tooltip:"""""" )
<$button tooltip="""$tooltip$""" class="tc-btn-invisible">
<$action-listops $field="""$fld$""" $filter="""[enlist{!!$fld$}toggle$value$]"""/>
<$text text={{{ [all[current]field:$fld$[]then[-----]else{!!$fld$}] }}} /> $label$
</$button>
\end
\define cycle-field(fld:"""myfield""" value:"""on off""" label:"""""" tooltip:"""?""" )
<$button tooltip="""$tooltip$""" class="tc-btn-invisible">
<$action-listops $field="""$fld$""" $filter="""[enlist{!!$fld$}cycle[$value$]]"""/>
<$text text={{{ [all[current]field:$fld$[]then[-----]else{!!$fld$}] }}} /> $label$
</$button>
\end
but i’m stuck with the problem of space in the field value, in a real case scenario i would use
<<toggle-field fld:"status" value:"[da leggere],[in lettura],[letto]" label:"" tooltip:"libro letto?" >>
and I end with a value in the field of [[in lettura]]
or [[da leggere]]
.
My field aren’t “list field” so I don’t want the value enclosed in square brackets I need: in lettura
or da leggere
in the field.
Searching https://tiddlywiki.com/#enlist%20Operator was useless.
Please give me an advice. Thank!