The $subfilter attribute expects some type of *filter* to be handed to it. 
Unless your user types in an actual filter phrase, 
{{$:/state/new-button-caption}} won't work.

The filter string syntax allows transclusions inside the string with a 
single set of curly braces. So this:

  subfilter="[{$:/state/new-button-caption}]"

means take the value inside of $:/state/new-button-caption and insert it 
(transclude it) between the square brackets as though it were in-lined with 
it's own square brackets. So if tiddler $:/state/new-button-caption 
contained "My Exciting Tiddler" then the filter would see:

  subfilter="[[My Exciting Tiddler]]"

which is also the same as

  subfilter="[title[My Exciting Tiddler]]"


HTH
-- Mark

On Monday, October 22, 2018 at 2:22:09 PM UTC-7, Rollo ro wrote:
>
> Hi,
>
> @Mark: I spent countless hours with reading the documentation and trying 
> to get the correct expression without success, and could finally get my 
> code working after reading your post. Thanks for that!
>
>
> I wanted to use
>
> <$action-listops $subfilter={{$:/state/new-button-caption}} 
> $field="myfieldoftitles"/>
>
> to add an title which was typed in a text box. This failed for titles with 
> spaces and I could not figure out how to get the [[ brackets without 
> requiring the user to type it. Now I found that it works with
>
> <$action-listops $subfilter="[{$:/state/new-button-caption}]" 
> $field="myfieldoftitles"/>
>
> This is much like what Mark posted. I just had to remove !! to be able to 
> access my variable. This is what I understand, but I don't understand the 
> rest of the syntax at all. I'd appretiate if someone could explain what the 
> code actually means. Or how it is interpreted.
>
>   
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/fb6d6f10-261a-45af-b7e1-d530319b6aa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to