Show content of a field in title

93 views
Skip to first unread message

vinvi...@gmail.com

unread,
Oct 3, 2020, 5:50:18 AM10/3/20
to TiddlyWiki
Hello,

This shows the contents of a field:
{{!! fieldname}}

How to display the content of a field in the tiddler title?
Can I use a code?

Thank you,

Eric Shulman

unread,
Oct 3, 2020, 7:40:23 AM10/3/20
to tiddl...@googlegroups.com
The tiddler title is not just for display.  The most important use of a tiddler title as a UNIQUE identifier for the tiddler.
The title should *never* include anything that could be a computed piece of text (such as a field reference).

However... if you want to *display* something in place of the title that *does* contain a field reference, then you can use the "caption" field to specify the desired output.
For example, you could have a caption field that contains: "This is {{!!somefield}}", or even "This is <<someMacro>>"

Then, to substitute the "caption" in the tiddler ViewTemplate, you can edit the $:/core/ui/ViewTemplate/title shadow tiddler, and replace this line:
<$view field="title"/>
with:
<$transclude field="caption"><$view field="title"/></$transclude>

Note that this has the potential to cause confusion since the "fake title" (caption text) that appears in the tiddler display can be completely different from the actual title field of the tiddler.
And you can even have more than one tiddler that uses the exact same caption text, and thus will *appear* to have the same "fake title", even though the actual tiddler titles are uniquely different from each other.

Of course, it's up to you to use this modified tiddler display carefully so as not to confuse yourself and especially anyone else that may be viewing your TiddlyWiki.

enjoy,
-e

vinvi...@gmail.com

unread,
Oct 4, 2020, 3:02:28 AM10/4/20
to TiddlyWiki
Thank you, 

Op zaterdag 3 oktober 2020 om 13:40:23 UTC+2 schreef Eric Shulman:
Reply all
Reply to author
Forward
0 new messages