TW5:Show field value for current tiddler derived from transcluded tiddler

739 views
Skip to first unread message

David Retherford

unread,
May 10, 2016, 6:52:37 AM5/10/16
to TiddlyWiki
I am creating tiddlers to track my tasks using published examples as a starting point. For my tasks, I have added a field named "reference" which contains a value that references an external help desk system. To make it easier to create new task tiddlers I have created a tiddler named "Task Template" to use as a template for new tasks. The template includes a line to show the value of the "reference" field as follows:

{{!!reference}}

I was hoping to incorporate the "Task Template" into new tasks by using transclusion. To create a new task I am doing this:

1. Create tiddler for the new task
2. Add field "reference" with appropriate value
3. Edit tiddler text to transclude the template is a follows:

{{Task Template}}
<hr>

The issue I am having is the value of the "reference" field that is displayed in the new task tiddler is coming from the "Task Template" tiddler and not from the "current" tiddler.

Would it be possible to revise the template so it would instead display the "reference" field value in the tiddler it is transcluded in?

Thank you.




Eric Shulman

unread,
May 10, 2016, 7:23:09 AM5/10/16
to TiddlyWiki
On Tuesday, May 10, 2016 at 3:52:37 AM UTC-7, David Retherford wrote:
I was hoping to incorporate the "Task Template" into new tasks by using transclusion. To create a new task I am doing this:
1. Create tiddler for the new task
2. Add field "reference" with appropriate value
3. Edit tiddler text to transclude the template is a follows:
{{Task Template}}
<hr>
The issue I am having is the value of the "reference" field that is displayed in the new task tiddler is coming from the "Task Template" tiddler and not from the "current" tiddler.

To render TaskTemplate using the tiddler data (fields) from the current tiddler, see:

Summary: the full notation for transclusion is {{target||template}}, where "target" is the name of the tiddler containing the data (fields) and "template" is the name of the tiddler containing the output formatting (wikitext) with references to the data fields.  If the template is omitted (i.e., just {{target}}) then a simple transclusion is performed and both the data and the output format come from the indicated target tiddler.  If the target is omitted, (i.e., just {{||template}}), then a "transclusion with template" is performed, using data from the current tiddler and the output format from the indicated template tiddler.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
InsideTiddlyWiki: The Missing Manuals

David Retherford

unread,
May 10, 2016, 8:46:47 AM5/10/16
to TiddlyWiki
Exactly what I needed. Thanks!
Reply all
Reply to author
Forward
0 new messages