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. 

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 
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: PRIMARY

outer: {{!!primary-field}}

inner: {{inner}}

*inner *



This doesn't work, because {{inner}} sets the currenTiddler variable to 
"inner". So we need to change outer to:


inner: {{||inner}}
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!

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to