When a macro is used as a widget parameter value, its content is simply used as the literal value of the parameter, without being “wikified”. Thus, your code above would be equivalent to: (note the double quotes surrounding the value)
<$button disabled="{{{ [{!!search_tmp}length[]compare:number:lt[2]then[yes]] }}}">...
In contrast, using the {{{
and }}}
around the widget parameter value DOES cause the filter syntax to be evaluated, so that the parameter value is the desired filter results, rather than the filter syntax itself.
Also is that the only purpose of subfilter
to evaluate a filter from a variable? I read the description of that operator many times and never quite understood its purpose.
The subfilter
filter operator can also be used to evaluate a filter that is stored as the contents of a tiddler field or index, as in:
subfilter{!!somefield}
or
subfilter{##someindex}
or
subfilter{sometiddler}
(which is equivalent to subfilter{sometiddler!!text})