On Sunday, February 10, 2019 at 10:33:04 PM UTC-8, Christine wrote:
>
> 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.
>

This should do what you want:
<$count filter="[<currentTiddler>addsuffix[_state]list[!!ckl_checked]]" />
/
<$count filter="[<currentTiddler>addsuffix[_state]list[!!ckl_items-enabled]]" 
/>

* The first part of the filter constructs the target tiddler title by 
combining the current tiddler title with the "_state" suffix.
* The second part uses the list[...] filter syntax as before, but *omits 
the literal tiddler title*, so that the remaining field reference (e.g., 
[!!ckl_checked]) is relative to the target tiddler title preceding it in 
the filter.

Let me know how it goes.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3bbad7a2-d593-4357-841a-a6e4783c032b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to