mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-05 05:30:02 +00:00
Minor adjustments to existing doc tiddlers without changing modified date (#8057)
This commit is contained in:
parent
8d36ecd6bc
commit
0b7914785c
@ -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|<<currentTiddler>>-Contact]]`">>
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user