How to use the "strict" flag for tag operator?

38 views
Skip to first unread message

Jeff Vance

unread,
Dec 25, 2017, 2:53:52 PM12/25/17
to TiddlyWiki

I'm trying to use the new suffix option in the tag filter operator, as described here:

https://tiddlywiki.com/#tag%20Operator

I don't understand the syntax for how to actually set the "strict" flag. At first I thought it would be like:  tag[:strict  some_tag].  Or maybe tag[strict:  some_tag].  Neither of these seems to work. 

And...if it works, is my understanding correct:  if the tag doesn't exist, it should continue using the full list of input titles?  So if this is defined inside a macro, with a parameter for the tag to filter on, and in some cases I leave the parameter undefined, it should produce the full list without that tag filter....right?  For example, I was thinking of doing something like this:

Macro that will filter on a tag and an optional project tag. If the project tag exists, it will list only titles tagged by both my_tag and the project tag. If the project tag doesn't exist, just list everything with the first tag. (what I really want is actually more involved than this, but this is a simplified example)



<$macrocall $name="proj_tiddlers" my_tag="example1" proj="Project A"/>
<$macrocall $name="proj_tiddlers" my_tag="example2" proj="Project B"/>
<$macrocall $name="proj_tiddlers" my_tag="example3"/>


\define proj_tiddlers(my_tag  proj)    
  <$list filter="[tag[$my_tag$]tag[strict: $proj$]]">
    ...



Jeff Vance

unread,
Dec 25, 2017, 3:02:25 PM12/25/17
to TiddlyWiki
Ah, nevermind....I figured it out.  I shouldn't have given up so easily.  I now see it is tag:strict[some_tag].  So far it seems to be working the way I want, but I need to test this out more.





Reply all
Reply to author
Forward
0 new messages