Continuing the discussion from [tw5] Seeking common misunderstandings:
@sobjornstad I am not sure if some of these are things you have covered already, and I am struggling a bit to remember everything I wrote the first time around, but these are some of the common gotchas that I warn people about after introducing them to TiddlyWiki.
Filtered transclusions
The triple brace syntax {{{ filter }}}
is often mistakenly thought of as a filter evaluation mechanism that can be used in wikitext to display the results of a filter. This misses the point that this is a transclusion of the filter results through a template, where the default template generates links from the output titles (just like the List Widget). Not realizing this leads to users struggling to understand why the output is always a link, or why a |
character in the filter breaks the syntax.
Differentiating between triple and double braces in wikitext vs widget attributes
Double and triple braces in wikitext are transclusions through optional templates. The templates feature is not available when using double and triple braces for widget attributes.
That HTML tags are widgets
… and all the same rules apply about using macros, variables, transclusions and filtered transclusions for their attributes.
Filters for text concatenation
Quite often using filters for text concatenation is easier and helps avoid some of the issues around macros that need wikification before they can be used as widget attributes.
Slow down with the wikify
If you are using the Wikify widget frequently in your code, you probably have a suboptimal code structure. (Wikify has rather poor performance in the refresh cycle.) Note how sparingly wikify is used in the TiddlyWiki core code, despite the entire user interface being built with wikitext. Using wikify should be the exception, for the rare situations where you need the rendered output of some wikitext, and not the rule.
Set Widget and filter attribute
If you use the Set widget with a filter
attribute and do not specify a value
attribute, you are asking for a list of output titles, not a single title. In a list, even if there is only one title, all titles with spaces will be enclosed in brackets (title list format). To get just the first title and with no brackets, use select="0"
to select the first title.
In general if all you need is a single title as output from a filter, using a Vars widget is less likely to trip you up.