[TW5] Transcluding a tiddler Title above body text (with link to open)

58 views
Skip to first unread message

Jeff Vance

unread,
Feb 16, 2017, 12:05:45 PM2/16/17
to TiddlyWiki
I found a few examples online that show how to use a template that will transclude the title of a tiddler above the body text. However, I tried creating such a template and applying it to the Tabs macro and it doesn't wikify the Title, or in fact anything I try to type there.  What I really want is for it to display as a main header (and even better, make it a link to open the tiddler outside the tab for editing).

For example:  if I try this, in a template:

<$tiddler tiddler=<<currentTab>>>
! <$view field="title"/>
<$transclude mode="block"/>
</$tiddler>

If I apply this template to the tabs macro, the body text shows up fine, but the title is plain text with ! in front.
In fact any text I type there doesn't seem to by wikified.(like: !Test Title)

This seems the same as other examples I've found online, so I'm not sure if there is something different when using the tabs macro.
Or maybe something changed in recent versions of TW that requires a different way? I appreciate any tips!

Jed Carty

unread,
Feb 16, 2017, 12:18:04 PM2/16/17
to TiddlyWiki
It is probably because the parsing is getting confused, this happens sometimes inside macros and templates. You would need to either put a line break above (and possibly below) the ! <$view field='title'/> line, if that doesn't work use <h1> tags instead of !

Jeff Vance

unread,
Feb 16, 2017, 12:35:48 PM2/16/17
to TiddlyWiki
Ok, you are correct!  I tried adding a line break above and it suddenly worked.  A line break below was not necessary.

However, I kept experimenting and I found another way that I like better without using the view widget.  Using your suggestion to apply <h1> tags, I can make the header a link using the link widget, which is ultimately what I wanted.  This seems to work really well.  Thanks for the tips!

<$tiddler tiddler=<<currentTab>>>
<$link to=<
<currentTiddler>>><h1>{{!!title}}</h1></$link>
Reply all
Reply to author
Forward
0 new messages