Just a neat use of Relinks "References" feature

177 views
Skip to first unread message

Charlie Veniot

unread,
Apr 24, 2021, 1:09:34 AM4/24/21
to TiddlyWiki
{{||$:/plugins/flibbles/relink/ui/TiddlerInfo/References}}

Slap that in the text of a tiddler (say tiddler A) and you will get a list of every reference to tiddler A from pretty much everywhere:
  • any field (text and any other field including custom fields)
  • any transclusion
  • any link
  • any macro
  • any widget
Kind of cool.

TW Tones

unread,
Apr 24, 2021, 1:15:28 AM4/24/21
to TiddlyWiki
Yes,

We kind of forget sometimes that in every solution in tiddlywiki there can be multiple sub-solutions. Sometimes this slows my development because I want to expose them, all.

Tones

Charlie Veniot

unread,
Apr 24, 2021, 1:18:01 AM4/24/21
to TiddlyWiki
Dig into that relink tiddler a little and one quickly discovers that one can do this:

<$list filter="[relink:references<currentTiddler>!title[$:/StoryList]sort[title]]"/>

Woo-holy-guacamole-hoo!  Rock'n Roll !

TW Tones

unread,
Apr 25, 2021, 12:18:32 AM4/25/21
to TiddlyWiki
What does it do?

Charlie Veniot

unread,
Apr 25, 2021, 12:40:34 AM4/25/21
to TiddlyWiki
{{||$:/plugins/flibbles/relink/ui/TiddlerInfo/References}}

That will give slightly preformated content, so list of links to referencing tiddlers, preceded by the header "The following tiddlers contain fields, links, macros, transclusions, or widgets referencing this one:"

<$list filter="[relink:references<currentTiddler>!title[$:/StoryList]sort[title]]"/> was just to demonstrate that the real value is in the filter [relink:references<currentTiddler>!title[$:/StoryList]sort[title]].  As is, that list widget example does the same thing as the transclusion minus the header, and that's not so much of a big deal.

It's just that using a list widget provides way more flexibility than the transclusion.  The list can be formatted however anybody could want, having a modal per tiddler instead of a link per tiddler, or maybe setup the list of tiddlers in a table instead of a list, or whatever other custom layout/formatting.

PMario

unread,
Apr 25, 2021, 3:49:24 AM4/25/21
to TiddlyWiki
Hi,
I think this is even more compact

Backlinks: <$list filter="[relink:references<currentTiddler>!title[$:/StoryList]sort[title]]"><$link/>, </$list>

-m

Charlie Veniot

unread,
Apr 25, 2021, 9:28:31 AM4/25/21
to TiddlyWiki
For sure, that is very nicely compact.

I guess my gist was that it is nice how we can get from relink a simple list of tiddlers that reference (in pretty much every possible method) some tiddler, which we can then layout/format in any way that suits any purpose/preference, be it nicely compact like you've just done, or very expansive/adorned with anything at all.

Just as a quickly cobbled together example:

<table>
<$list filter="[relink:references<currentTiddler>!title[$:/StoryList]sort[title]]">
<tr>
<td>
<$link/>
</td>
<td>
<$list filter="[relink:references<currentTiddler>!title[$:/StoryList]sort[title]]"><$link/>, </$list>
</td>
</tr>
</$list>
</table>


Reply all
Reply to author
Forward
0 new messages