Fields are an integral part of the tiddler. So whenever you access eg: HelloThere all the fields that are defined with it, are also there. Fields always live in the context of the current tiddler.
eg:
HelloThere has a "list-field" ... You can access this field from everywhere with {{HelloThere!!list}}
If you want to transclude the "text-field" you can use {{HelloThere!!text}}
Because we are lazy folks, we don't want to type too much there is a convenient function built in to TiddlyWiki: "whenever a transclusion is specified, the text field is used as the
default field value." So we can write: {{HelloThere}} if we want the content.
Sometimes we don't want to specify the tiddler title, because it should be dynamic. So we want to use: {{!!list}}. TW has a problem now. The tiddler title is not defined anymore. ... That's why a sensible default is used: The <<currentTiddler>> variable. This currentTiddler variable is set by the
ViewTemplate, with the
tiddler widget.
The transclude-widget uses the currentTiddler variable, but doesn't set it! That's important!!!!
Let's create 2 test tiddlers:
outer and
inner. Where outer is the primary tiddler, that transcludes the inner tiddler. The inner tiddler want's to access the primary-field ... That's what you want. right?
outer .... defines a field eg:
primary-field: PRIMARYouter:text
outer: {{!!primary-field}}
inner: {{inner}}
-----
inner
{{!!primary-field}}----------------
This doesn't work, because {{inner}} sets the currenTiddler variable to "inner". So we need to change outer to:
outer: inner: {{||inner}}
or
inner: <$transclude tiddler=inner/>
So the currentTiddler variable isn't changed and the inner tiddler sees the primary-field. We call this mechanism "
Transcludion with Templates" .... inner is a template now.
... part 1 .... more to follow
hope that helps a bit
have fun!
mario