Thank you Eric,

That is exactly what I needed, and it works great.  I read about the 
ViewWidget <https://tiddlywiki.com/#ViewWidget> but saw nothing that 
suggested this.  Is there a better place I should be looking for such 
information, so that I don't keep bothering people here with simple 
questions?

  -- Scott

On Wednesday, May 13, 2020 at 3:33:18 PM UTC-4, Eric Shulman wrote:
>
> On Wednesday, May 13, 2020 at 12:04:43 PM UTC-7, Scott Sauyet wrote:
>>
>> I'm hoping to do that conditionally with something that works like this:
>>
>> <h2 class="tc-title">
>> <if field caption exists><then><$view field="caption"/></then><else><$view 
>> field="title"/></else></if>
>> </h2>
>>
>> Obviously the syntax is nowhere near real, but I think it should 
>> demonstrate what I'm trying to do.  Is this readily achievable?
>>
>
> The above functionality is already built into the <$view> widget:
>
> in the documentation (https://tiddlywiki.com/#ViewWidget) it says:
>
> *The content of the <$view> widget is displayed if the field or property 
> is missing or empty.*
>
> Thus, you would write something like this:
> <$view field="caption"><$view field="title" /></$view>
>
> Note how the outer $view widget has a matching /$view, and the inner $view 
> widget uses the "short form" with the "/>" ending.
>
> enjoy,
> -e
>
>
>  
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d63025e9-7840-4143-a914-7b063fc8a020%40googlegroups.com.

Reply via email to