Hey, Coda —

The substitution in your example there *should* work fine, so I suspect the 
trouble lies elsewhere.  For example, this works:

\define testSearchBar(field)
<$if value={{$:/temp/search!!$field$}} match="yes">
Search is "yes"
</$if>
\end

<<testSearchBar text>>

Remember that a macro can't define *only* the opening tag of a widget; it 
needs to define the content and closing tag as well...

On Saturday, 30 December 2017 15:24:20 UTC-6, coda coder wrote:
>
> Hi Evan...
>
> On Friday, December 29, 2017 at 11:54:54 PM UTC-6, Evan Balster wrote:
>>
>>
>> As compared with the closely-related *$reveal* widget, conditions are 
>> simpler, behave more like *$list*, and can be executed as a chain.  They 
>> don't retain contents or animate, and can be based on variables, filtered 
>> or transcluded attributes rather than just state tiddlers.
>>
>>
> I'm no expert but, I think there's a reason that Jeremy chose to use a 
> TextReference for use by the state attribute of the $reveal widget.  When I 
> just tried to switch one out for the $if widget, I hit a snag:
>
> <$reveal type="match" state="someTiddler!!$switch$" text="yes">
>
> Note that the field part of the reference is supplied as a parameter to 
> the outer macro wherein this line occurs.  I don't see a way to directly 
> replace the above using the $if widget -- the following of course does not 
> work:
>
> <$if value={{$:/.rgt/bk/author-data!!$switch$}} match="yes">
>
> Do you think it possible to make TextReferences work with $if?  Otherwise, 
> the neater and much more readable $if widget would need a needless variable 
> ($wikify?) to prepare the transclusion value for its use by $if (I think).  
> Right?
>
> Hope that made sense...
>
> Coda
>

-- 
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/83b89ad1-867d-4232-a40e-3edccd28c1f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to