# Two-way linking: footnote of related tiddlers, issues, references

220 views

### bimlas

Nov 18, 2019, 2:02:29 AM11/18/19
to TiddlyWiki
In TiddlyWiki you can create direct links to a tiddler or list them according to a filter. However, there are times when it would be nice for a tiddler to automatically appear at all connected tiddlers without doing anything. Thus I created a two-way link "mechanism": instead of referring to the source, the source specifies which tiddlers it is linked to. This is useful when, for example, I want to remind myself of a possibility of error.

The easiest way to understand this is to look at a specific example: https://bimlas.gitlab.io/#Proper%20shebang%20line

This tiddler is about the correct form of the shebang line (needed for shell scripts). Since I'm not always going to remember this, I want to make sure that TiddlyWiki reminds me when I viewing a tiddler contains shell code, so I defined the conditions under which this information will be displayed (as a filter in "condition-to-show-in-footnote" field of this tiddler).

[search[#!/usr/bin/]]

So for those tiddlers that have the phrase "#!/usr/bin" in their text, I'd like to automatically see a link to the shebang note, thus I created a viewtemplate (attached as well) to display the link where this condition is met, and to list these target tiddlers for the shebang note.

With this solution, I only need to set up a filter once and a link to the source always appears at the bottom of the associated tiddlers.

Attention! Use a simple filter that doesn't take much time to execute, otherwise the wiki may become slow (for example, don't use the Kin filter).
$__bimlas_footnote-of-possible-issues_template.json ### TonyM unread, Nov 18, 2019, 3:28:38 AM11/18/19 to TiddlyWiki Bimlases Thanks for sharing. I have done similar things before. One way to reduce the influence of complex filters is to only show the "related tiddlers" if a tiddler has a tag or field name toggled on. So just toggle on for relevant tiddlers, or toggle the whole system on or off. The best solution is a global toggle you can override localy on each tiddler. I have some nice code for this if you want. Regards Tony ### bimlas unread, Nov 18, 2019, 5:20:46 AM11/18/19 to TiddlyWiki TonyM, Please give me an example because I don't quite understand. ### TonyM unread, Nov 18, 2019, 7:10:21 AM11/18/19 to TiddlyWiki Quick dump more tomorrow$:/config/relatedTiddlers
Contains show or hide

Macro tiddler
'
\define Related()
<$set name=result value={{!!relatedTiddlers}} emptyValue={{$:/config/relatedTiddlers}}>
<<result>>
</$set> \end In a tiddler or view template <<Related>> will return the global setting in$:/config/relatedTiddlers unless the field on the current tiddler relatedTiddlers overrides the global.

E.g.
<$list filter="[<showRelated>match[show]]" variable=nul> Insert your code here to show </$list>

### bimlas

Nov 20, 2019, 4:01:32 AM11/20/19
to TiddlyWiki
More specifically, this is not exactly what you were thinking, but serves a similar purpose.