Howdy!
Is there a way for a tiddler to “know” that it’s being transcluded in something else? So that it displays differently when transcluded vs. when it’s viewed vs. when it’s edited?
Like, there’s a ViewTemplate
and an EditTemplate
… so if I want to decorate how my tiddlers display by themselves when being viewed I can create a new tiddler, tag it $:/tags/ViewTemplate
and code up some UI. Same for $:/tags/EditTemplate
when it’s being edited.
Is there a way to do something similar for transclusions, across the board?
Here’s my use case: I have tiddlers tagged “Highlight” that are passages from books or websites that I like. For almost all of them I write them as big blockquoted sections:
<<<
Here is the text of the highlight. It can get pretty long in here.
And run to multiple lines.
<<< via [[The Tiddler of the Thing I Got It From]]
That way when I transclude them into other pieces of writing I know where they came from.
It’d be awfully swell if the TransclusionTemplate
(I know that’s not a thing) could detect that I’m transcluding something tagged “Highlight” and format it differently. That way, the tiddler itself could just be this:
Here is the text of the highlight. It can get pretty long in here.
And run to multiple lines.
…and I can have fields like source
that point back at the source of the highlight. Then, when it’s transcluded, it looks more like what I’m doing now.
I think I’m going to end up making a macro that does this for me that transcludes these things through a template to handle the formatting, but I wanted to make sure I wasn’t missing anything. Being able to write {{Here is an interesting highlight}}
is handier than <<my-new-macro "Here is an interesting highlight">>
, but if I’m going to end up macro’ing up then so be it.
Thanks!