How to get mytemplate title when we use {{||mytemplate}}?

85 views
Skip to first unread message

Siniy-Kit

unread,
Nov 29, 2017, 11:21:32 PM11/29/17
to TiddlyWiki
Hi! I make  tiddler with title  mytemplate and text <<currentTiddler>>, <<storyTiddler>>
then I make NewTiddler with text {{||mytemplate}}

the result is 
NewTiddler, NewTiddler

but i want to get result
NewTiddler, mytemplate

how can I get template title not as currenttiddler?

TonyM

unread,
Nov 30, 2017, 3:32:02 AM11/30/17
to TiddlyWiki
Siniy,

I presume it is not good enough to have in the template tiddler
 text <<currentTiddler>>, [[mytemplate]]?

Since you know the name of the template when you transclude it, why not make a macro that creates a variable and transcludes the template?

Perhaps you could have a global macro of this form (tested)

\define displaytemplate(templatename)

<$set name=template value=$templatename$>

{{||$templatename$}} 

</$set>
\end

In the calling tiddler
<<displaytemplate "MyTemplate" >>

In the MyTemplate Tiddler
<<currentTiddler>>, <<template>>

Regards
Tony

Xavier Cazin

unread,
Nov 30, 2017, 10:27:38 AM11/30/17
to tiddl...@googlegroups.com
Hello Siniy-Kit

You may want to use the special transclusion variable. See https://tiddlywiki.com/#transclusion%20Variable%20(Examples)

Cheers,

-- Xavier Cazin

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3b70b19c-2838-4f73-97f1-ccc2e4924197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sini-Kit

unread,
Dec 1, 2017, 3:59:42 AM12/1/17
to TiddlyWiki
Thank you Tony. Your variant works good.

четверг, 30 ноября 2017 г., 11:32:02 UTC+3 пользователь TonyM написал:
Reply all
Reply to author
Forward
0 new messages