Hi Tony,

I think, you are mixing up fundamentally different things (fields, 
variables and macros), and that gives you a headache. I'll try to point you 
into the right directions.

On Sunday, July 16, 2017 at 4:18:03 AM UTC+2, TonyM wrote:

> Using field values in my primary tiddler,
>

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 
<http://tiddlywiki.com/#TranscludeWidget>." 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 
<https://github.com/Jermolene/TiddlyWiki5/blob/master/core/ui/ViewTemplate.tid#L9>,
 
with the tiddler widget 
<http://tiddlywiki.com/#TiddlerWidget:TiddlerWidget%20%5B%5BcurrentTiddler%20Variable%5D%5D%20%5B%5BstoryTiddler%20Variable%5D%5D>.
 


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: PRIMARY
outer: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 
<http://tiddlywiki.com/#Transclusion%20in%20WikiText:%5B%5BTransclusion%20in%20WikiText%5D%5D%20%5B%5BTransclusion%20with%20Templates%5D%5D>"
 
.... inner is a template now. 

... part 1 .... more to follow

hope that helps a bit
have fun!
mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d04487a9-f8f1-4b22-97d2-8a079ca0724a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to