diff --git a/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid b/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid index 82cbda969..9434bf6f9 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperator fields.tid @@ -1,5 +1,6 @@ +caption: fields created: 20140924115616653 -modified: 20140924115627781 +modified: 20141002150019737 tags: Filters title: FilterOperator: fields type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/variables/Variables.tid b/editions/tw5.com/tiddlers/variables/Variables.tid new file mode 100644 index 000000000..1f52b5f3e --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/Variables.tid @@ -0,0 +1,13 @@ +created: 20141002133113496 +modified: 20141002142932824 +tags: Reference +title: Variables +type: text/vnd.tiddlywiki + +Variables together with [[Widgets]] and [[Macros]] are essential for dynamic WikiText. + +You can define your own [[Variables in WikiText]] or use built-in variables. + +More detailed information of built-in variables could be found in below: + +<> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/WidgetVariable_ currentTiddler.tid b/editions/tw5.com/tiddlers/variables/WidgetVariable_ currentTiddler.tid new file mode 100644 index 000000000..dee4ab522 --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/WidgetVariable_ currentTiddler.tid @@ -0,0 +1,20 @@ +caption: currentTiddler +created: 20141001232824187 +modified: 20141002133837818 +tags: Variables +title: WidgetVariable: currentTiddler +type: text/vnd.tiddlywiki + +<<< +The ''currentTiddler'' variable containes the title of the current tiddler. + +The ListWidget assigns the list result to the ''currentTiddler'' variable, unless the `variable` attribute is specified. + +A couple of [[Widgets]] and [[Macros]] by default apply to the tiddler according to the ''currentTiddler'' variable. + +The TranscludeWidget (or WikiText `{{||TemplateTitle}}`) transcludes a tiddler without changing the ''currentTiddler'' variable. +<<< + +These mechanisms together allow you to write references like `<$view field="title" format="link"/>` in TemplateTiddlers or inside the ListWidget hierarchy without explicitly specifying the tiddler that it applies to. + +See also [[WidgetVariable: storyTiddler]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/WidgetVariable_ storyTiddler.tid b/editions/tw5.com/tiddlers/variables/WidgetVariable_ storyTiddler.tid new file mode 100644 index 000000000..2153fc6e3 --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/WidgetVariable_ storyTiddler.tid @@ -0,0 +1,10 @@ +caption: storyTiddler +created: 20141001232753952 +modified: 20141002133957245 +tags: Variables +title: WidgetVariable: storyTiddler +type: text/vnd.tiddlywiki + +The ''storyTiddler'' variable is set by the [[default viewtemplate|$:/core/ui/ViewTemplate]] to the name of the current tiddler within tiddlers in the story river, and is not defined within the sidebar. + +See also [[WidgetVariable: currentTiddler]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/WidgetVariable_ transclusion.tid b/editions/tw5.com/tiddlers/variables/WidgetVariable_ transclusion.tid new file mode 100644 index 000000000..63051d770 --- /dev/null +++ b/editions/tw5.com/tiddlers/variables/WidgetVariable_ transclusion.tid @@ -0,0 +1,35 @@ +caption: transclusion +created: 20141002004621385 +modified: 20141002133923307 +tags: Variables +title: WidgetVariable: transclusion +type: text/vnd.tiddlywiki + +The ''transclusion'' variable is set automatically by the transclude widget to contain a string that identifies the position of the current node within the widget tree. In the sidebar it is set to `{|$:/core/ui/PageTemplate/sidebar|||}` and within the tiddler "HelloThere" in the story river it is set to `{HelloThere|HelloThere|||}`. Each nested level of transclusion appends another curly bracketed list of symbols. + +The QualifyMacro uses the ''transclusion'' variable to identify the stack of transcluded tiddlers. + +! Example: + +``` +\define mymacro() +Hello from mymacro +<$list filter="[prefix[{|$:/core/ui/PageTemplate/sidebar|||}]]" emptyMessage="in a tiddler"> + in the sidebar + +\end + +<> +``` + +Result in story tiddler + +``` +Hello from mymacro in a tiddler +``` + +Result in the sidebar + +``` +Hello from mymacro in the sidebar +``` diff --git a/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid new file mode 100644 index 000000000..37cdead02 --- /dev/null +++ b/editions/tw5.com/tiddlers/wikitext/Variables in WikiText.tid @@ -0,0 +1,27 @@ +created: 20141002141231992 +modified: 20141002144153170 +tags: WikiText +title: Variables in WikiText +type: text/vnd.tiddlywiki +caption: Hard Linebreaks +! Defining Variables + +Variables contains values defined by [[Widgets]]. +Variables are available within the widget that defines them, and the child widgets in the widget tree. + +Variables are defined by: + +* TiddlyWiki core and viewtemplate +* SetWidget +* ListWidget +* [[Macro definition|Macros in WikiText]] + +! Using Variables + +Variables are used with: + +* Variable substitution `$(name)$` +* Concise shortcut `<>` +* [[Filter expression|Introduction to Filters]] `[operator]` + +Built-in [[variables|Variables]] are useful for dynamic WikiText. \ No newline at end of file