A question on Transclusion and Templating (TW5)

85 views
Skip to first unread message

Miles Smith

unread,
Aug 3, 2016, 9:30:51 AM8/3/16
to tiddl...@googlegroups.com
Hi guys, 

So for the longest time I have been using OneNote to organise my academic notes but have always found it lacking; I realised that what would make onenote great was really two features: transclusion and easier linking between notes, I realised what I needed was personal wiki and so I was incredibly pleased to discover this fantastic app which is exactly what I was looking for. 

That being said while the documentation is very good I find it is somewhat dry in places and I'd appreciate a little bit of help with a few questions I still have.

As suggested I am taking full advantage of the transclusion capabilities to keep my notes as small as possible. What I'd really like to be able to do is to automatically insert the title of a tiddler above the tiddler I'm transcluding. If it is possible then I imagine it would be with template tiddlers but here's where I find the documentation a little dry.

So essentially what I want I can currently achieve with:

!!{{Tiddler Name!!title}}
---
{{Tiddler Name}}


but if templates do what I assume they can do can that be achieved in one line with something like:

{{Tiddler Name||Template}}

?

Any help would be appreciated. 

Jed Carty

unread,
Aug 3, 2016, 9:57:36 AM8/3/16
to TiddlyWiki
I think you may find a better way to do what you want, but for now you can make a tiddler and call it something like ShowTiddler and put this as the content:

!!{{!!title}}

---

<$transclude/>

Then when you want to display the tiddler MyNote you put {{MyNote||ShowTiddler}}

Depending on what you want you may find the things I wrote about using lists here http://inmysocks.tiddlyspot.com/#Lists%20in%20WikiText useful

The Bo

unread,
Aug 3, 2016, 10:01:49 AM8/3/16
to TiddlyWiki
Hi Miles,

you could create a macro like this:

Tiddler:$:/core/macros/tiddlertitle
Tag: $:/tags/Macro
\define tiddlertitle(param)

!!{{$param$!!title}}
---
{{$param$}}

\end

And use it inside a tiddler:
<<tiddlertitle "tiddler name">>

Regards
The Bo

Miles Smith

unread,
Aug 3, 2016, 11:18:37 AM8/3/16
to tiddl...@googlegroups.com
Thanks, that was exactly what I was looking for and helped me understand how templates work. 

One note, I had to add mode="block" to stop it from breaking my formatting.
Reply all
Reply to author
Forward
0 new messages