At present: The *$transclude* widget treats any contained content as a fallback if the target of the transclusion is not defined (ie *a missing tiddler or a missing field*). The content of the *$view* widget is displayed *if the field or property is missing or empty*.
It has been suggested to change the behaviour of the $transclude widget so that: it will treat a blank string the same as a missing field. The reason is in this GitHub post by Jeremy and the comment preceeding it: Table of Contents toc-caption macro awkward behaviour <https://github.com/Jermolene/TiddlyWiki5/issues/3624#issuecomment-469043311> I vaugely recall mentions being made on the tiddlywiki Google groups where use is made of the difference in these two widgets to identify either an *empty* value *or* a *missing* field. What might be the consequences of changing the behaviour of the *$translcude* widget as suggested? On Saturday, February 9, 2019 at 5:41:32 PM UTC+7, S. S. wrote: > > Jeremy, > > You are right, the requested *wikified* format of the <$view> widget > would not differ from the wikified behaviour of the <$transclude> widget. > > But I believe it would be an efficient way to take advantage of this > difference shown below: > > The TranscludeWidget treats any contained content as a *fallback* if the >> target of the transclusion is not defined (ie a missing tiddler or a >> *missing >> *field). >> > > The content of the <$view> widget is *displayed* if the field or property >> is *missing* or *empty*. >> > > The difference is that for the <$view> widget, the fallback content > displays when the field is *empty*. > > The alternate would be to use a <$list> widget, which I believe is much > less efficient to catch this scenario a few hundred times during a refresh > (as > mentioned by you on github > <https://github.com/Jermolene/TiddlyWiki5/issues/3624#issuecomment-444985661> > : *We don't want to make the core toc-caption macro too complicated > because it is typically rendered many times*.} > > It is similar to the way I think the below two are the same? > > <$text text={{!!caption}}/> > > <$view field="caption" format="text"/> > > I hope that explains *why* I am making this suggestion. > > Regards > > > On Saturday, February 9, 2019 at 3:57:17 PM UTC+7, Jeremy Ruston wrote: >> >> Hi SS >> >> As mentioned above, the view and transclude widgets work in a totally >> different way. Making the view widget behave like the transclude widget >> doesn't make sense because it would *be* the transclude widget. >> >> The behaviour you describe is already available via the transclude >> widget. So how would the behaviour of the proposed "wikified" format of the >> view widget differ from the existing behaviour of the transclude widget? >> >> Best wishes >> >> Jeremy >> >> -- >> Jeremy Ruston >> [email protected] >> https://jermolene.com >> >> -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" 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/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/f21ad4a0-4ed4-4215-b10d-31112d5b9384%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
