Wholesale transclude reference link

Hello.

I’m my workflow, as I build up texts, I end up weaving together lots of tiddlers into a text by transcluding them in. Because I work on the “weaving” tiddler as well as on the merged tiddlers iteratively, I often end up writing, on the tiddlers, a small link to themselves (with a tiny icon) so that I can use to identify and jump into them when needed.

Would there be a way to do this wholesale for all “naturally” transcluded tiddlers – that is, with the {{ }} syntax? I know it’d be possible to “macro them in” but that makes the host tiddler cumbersome and much less readable.

I imagine this might involve some monkey patching :monkey:, but that’d be fine by me.

If anyone knows where could I start looking, I’d be happy to dig in and report!

Thanks

Hi @gabrielmontagne

Here is a little code I use for this. Download this file:
transclude.json (721 Bytes)
Then import it in your wiki. It contains 2 tiddlers: a transclusion template tr and a stylesheet tr-style.

To use it, just add the transclusion template to your usual transclusion syntax.

{{my_target_tiddler||tr}}

(note the ||tr part at the end).

A click on the upper-right :link: icon opens transcluded tiddler in edit mode.

Hope this helps,

Fred

2 Likes

thanks! I’m so glad I asked! It hadn’t occurred to me that that could be done. Super useful! And, well, TW is so flexible I sometimes forget.

I quickly made an inline variation also. div → span and transclude inline on a new [[tri]].

thanks again!

1 Like

I think @tw-FRed’s solutions a good one. I just thought I would add, when creating a transclusion, or after the excise editor toolbar button has a macro option, and by default uses the translink macro, this results in something like this;

<<translink """test""">> where test is the “transcluded” tiddler.

the result is like this;

2025-10-18_10-22-16

  • The tiddler title in a box with its content transclude within.

Of course you could use your own macro, and I think and extencion to the excise tool, or another tool to be able to provide the template as in Freds tr transclusion template.