[TW5] Get the value of a related Tiddler to use in the text of another Tiddler.

60 views
Skip to first unread message

G

unread,
Mar 24, 2017, 9:29:55 AM3/24/17
to tiddl...@googlegroups.com
Hi there

I'm am trying to get the value of a related Tiddler to use in the text of another Tiddler. The setup is as follows:
  • Tiddler with title "Tiddler A" has a field "document_type"
  • Tiddler with title "Tiddler B" has a field "related" with as content "[[Tiddler A]]"

What I'm try to accomplish is to get the value of the "document_type" of Tiddler A in the text of Tiddler B. I tried it using the View Widget as follows

<$view tiddler={{!!related}} field="document_type"/>

But I keep struggling with the fact that the "related" field contains brackets. It is important to note that the Tiddlers I use contain spaces in their titles.

Does anyone know a solution for this?

Thank you.

Matt Groth

unread,
Mar 24, 2017, 9:52:12 AM3/24/17
to TiddlyWiki
Why do you need brackets in the related field?

G

unread,
Mar 24, 2017, 10:00:33 AM3/24/17
to TiddlyWiki
I'm used to doing so when I work with the "list" field to relate to multiple Tiddlers like for example a Tiddler C with a field "list" containing "[[Tiddler A]] [[Tiddler B]]".

I think that without the brackets each of the words in the "list" field is considered  to be a separate title, but I can be mistaken.

Matthew Lauber

unread,
Mar 24, 2017, 10:57:09 AM3/24/17
to TiddlyWiki
You could wrap the <$view> in a <$list> widget.  e.g.

<$list filter="[list[!!related]]">
<$view field="document_type">
</$list>

G

unread,
Mar 24, 2017, 12:10:45 PM3/24/17
to TiddlyWiki
Hi Matt, Matthew

Both of your solutions got me in the correct direction and now it is working. When removing the brackets in the "related" field, I was able to get the value of the "document_type" field.

Since I like the use of the angle brackets to be able create lists of Tiddlers or a link to a Tiddler, I went with the listWidget approach.

This allowed me to get the content of the "document_type" and other fields in a sentence using the following syntax

<$list filter="[list[!!related]]">
 The document is a {{!!document_type}} that conforms to the {{!!standard}} standard.
<$/list>

Thank you for helping me out with this exercise!

Best regards
Reply all
Reply to author
Forward
0 new messages