Say I add a checklist to a tiddler named To Do. The state tiddler is created as To Do_state. I can create the counter I want like this:
<$count filter="[list[To Do_state!!ckl_checked]]" /> / <$count filter="[list[To Do_state!!ckl_items-enabled]]" />However, I don't want to write in the tiddler name manually each time, so I'd like to create a macro that tells it to find the relevant field in a tiddler with a prefix of <currentTiddler> and a suffix of _state. But I can't figure out the correct syntax for this. I either get a wrong count, or it thinks I want a field of the current tiddler.
<$count filter="[<currentTiddler>addsuffix[_state]list[!!ckl_checked]]" />
/
<$count filter="[<currentTiddler>addsuffix[_state]list[!!ckl_items-enabled]]" />
<$list filter="[tag[xx]]">
<$text text=<<currentTiddler>>/>: <$count filter="[list[!!km]]" /><br>
</$list>
You could try :
\define ckl_state() $(currentTiddler)$_state
<$tiddler tiddler=<<ckl_state>>>
<$count filter="[list[!!ckl_checked]]" /> / <$count filter="[list[!!ckl_items-enabled]]" />
/$tiddler>
Regards
FrD