[TW5] Including a link when transcluding?

134 views
Skip to first unread message

Matthew Petty

unread,
Dec 8, 2015, 6:58:27 AM12/8/15
to TiddlyWiki
Is there a way to include a link to the tiddler being transcluded? When transcluding, I want to be able to click through to the original tiddler to edit it if necessary. A small single-character link would be OK. Is that possible?

Jed Carty

unread,
Dec 8, 2015, 7:35:56 AM12/8/15
to TiddlyWiki
You could just use something like this:
[[TiddlerName]] {{TiddlerName}}

If you want something fancier you could use this:

\define LinkAndTransclude(tiddler)
<$link to="""$tiddler$""">Whatever you want here</$link>

<$transclude tiddler="""$tiddler$""" mode=block/>
\end

You can change the text 'Whatever you want here' to whatever you want to show up as the link to the transcluded tiddler. Using $tiddler$ will use the tiddlers title. If you put this in a tiddler and then tag that tiddler with $:/tags/Macro than anywhere on your wiki you can put

<<LinkAndTransclude SomeTiddler>> which will make a link to SomeTiddler and transclude it.

Matthew Petty

unread,
Dec 8, 2015, 8:15:48 AM12/8/15
to TiddlyWiki
That's it! Perfect, thank you.

I made a macro as follows:
\define LinkAndTransclude(tiddler)
<$link to="""$tiddler$""">e</$link><$transclude tiddler="""$tiddler$""" mode=block/>
\end

To call the macro: <<LinkAndTransclude "Tiddler to be used">> (include quotes for titles with spaces)

Just click the 'e' to edit the tiddler.

Tobias Beer

unread,
Dec 8, 2015, 10:52:56 AM12/8/15
to TiddlyWiki
Hi Matthew,

Here's a little plugin called tobibeer/inc I just created that you may find useful:


inc macro


Best wishes,

Tobias.

Matthew Petty

unread,
Dec 9, 2015, 2:11:26 AM12/9/15
to TiddlyWiki
That's even better! This is great.

What I'm doing is making a CV / Resume for myself, using nested transclusions. The breakdown of tiddlers is roughly as follows. Each bullet is a tiddler, and they each transclude the next level down. The ability to edit each "leaf" of the "tree" without having to search for it is very useful!:
  • Resume root
    • Personal details
    • Qualifications
    • Experience
      • Current company UAE
        • Project 1
        • Project 2
      • Current company USA
        • Project 3
        • Project 4
      • Previous company USA
        • Project 5
        • Project 6
      • Previous company UK
        • Project 7
        • Project 8
      • Earlier company
        • Project 9
        • Project 10
This will come in very useful for many other tasks, I'm sure.

Best regards,
Matthew

Tobias Beer

unread,
Dec 9, 2015, 4:12:05 AM12/9/15
to TiddlyWiki
Hi Matthew,
 
The ability to edit each "leaf" of the "tree" without having to search for it is very useful!:

I guess one great feature would be to be able tell it to do inline editing,
rather than opening that tiddler for editing and scrolling away.
Will have to think about that.

Best wishes,

Tobias. 

Matthew Petty

unread,
Dec 9, 2015, 7:01:05 AM12/9/15
to TiddlyWiki
There was a plugin that allowed advanced table editing which held each cell of the table as a separate tiddler. Maybe this could be used there as well.

HansWobbe

unread,
Dec 12, 2015, 2:09:35 PM12/12/15
to TiddlyWiki
On Tuesday, December 8, 2015 at 10:52:56 AM UTC-5, Tobias Beer wrote:
Hi Matthew,

Here's a little plugin called tobibeer/inc I just created that you may find useful:



Tobi:

A really nice addition that fits into my work flow particularly well !

Thanks for sharing !!

Regards,
Hans

Reply all
Reply to author
Forward
0 new messages