diff --git a/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid b/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid index 77090609a..933e1e80e 100644 --- a/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid +++ b/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid @@ -4,10 +4,16 @@ tags: Learning title: Concatenating text and variables using macro substitution type: text/vnd.tiddlywiki +!! Important + <<.from-version "5.3.0">> It is recommended to use [[substituted attributes|Substituted Attribute Values]] or the [[substitute filter operator|substitute Operator]] to concatenate text and variables. It's a frequent use case in ~TiddlyWiki that you will want to put the results of variables together with various bits of strings of text. This process in some programming languages is often referred to as "concatenating" text. +--- + +!! What is Wrong + You might, for instance want to set up a template for your customer database, where links will automatically refer to additional contact information about your customer. Inside your tiddler, you might try something like this: <<.bad-example "`[[Additional Info|<>-Contact]]`">> diff --git a/editions/tw5.com/tiddlers/variables/Variables.tid b/editions/tw5.com/tiddlers/variables/Variables.tid index 65ad96b31..116f3c9a0 100644 --- a/editions/tw5.com/tiddlers/variables/Variables.tid +++ b/editions/tw5.com/tiddlers/variables/Variables.tid @@ -6,11 +6,12 @@ type: text/vnd.tiddlywiki !! Introduction -A <<.def variable>> is a snippet of text that can be accessed by name. The text is referred to as the variable's <<.def value>>. +* A <<.def variable>> is a ''snippet of text'' that can be accessed by name. +* The text is referred to as the variable's <<.def value>>. -Variables are defined by [[widgets|Widgets]]. Several core widgets define variables, the most common being the <<.wlink SetWidget>>, <<.wlink LetWidget>> and <<.wlink ListWidget>> widgets. +Variables are defined by [[widgets|Widgets]]. Several core widgets define variables, the most common being the <<.wlink LetWidget>>, <<.wlink SetWidget>> and <<.wlink ListWidget>> widgets. -The values of variables are available to descendant widgets, including transcluded content. For example, within each tiddler in the main story river the variable "currentTiddler" is set to the title of the tiddler. +The values of variables are available to descendant widgets, including transcluded content. For example, within each tiddler in the main story river the variable <<.var currentTiddler>> is set to the title of the tiddler. Variables can also be overwritten by descendent widgets defining variables of the same name, thus binding a different snippet to that name for the scope of the children of the widget.