I want to open the transcluded tiddler quickly and edit it from the current tiddler.
If I do transclusion in the current tiddler, in this way
{{tiddler title}}
Then, to edit the transcluded tiddler, I need to
edit the current tiddler,
copy the title of the transcluded tiddler
close the editing of the current tiddler
search for the transcluded tiddler
edit the transcluded tiddler
The solution I have right now is to transclude the tiddlers in this way
! [[tiddler title]]
{{tiddler title}}
This gives me a nice link in the heading of the transcluded tiddler. I can click on it and quickly edit it.
However, it has obvious drawbacks.
It is tedious and not automatic.
When exporting the current tiddler, I do not want the exported HTML to have deadlinks.
It forces me to have headings for every transcluded tiddler in the current tiddler, which may not always be suitable in the text.
Is there a better way of quickly jumping to the individual transcluded tiddlers?
3 Likes
Give this a try:
First, create a tiddler (e.g., “EditLink”), containing:
<$button class="tc-btn-invisible" style="float:right;"
message="tm-edit-tiddler" param=<<currentTiddler>>
tooltip={{{ [[edit "]addsuffix<currentTiddler>addsuffix["]] }}}>
{{$:/core/images/edit-button}}
</$button>
<$transclude mode="block"/>
This tiddler can be used as a “template” that transcludes a tiddler and automatically adds an edit button displayed in the upper right, like this:
{{HelloThere||EditLink}}
Note:
When viewing the “EditLink” tiddler, it will display a red error message:
Recursive transclusion error in transclude widget
This is caused by the <$transclude mode="block"/> widget and can be safely ignored as the message will only appear when directly viewing the “EditLink” tiddler itself.
enjoy,
-e
3 Likes
JanJo
September 12, 2022, 9:21pm
3
I often had the same thought. It would be great to have an automatic display of the link in the edit-view.
boris
September 12, 2022, 9:28pm
4
I wrote up about how I use the inc-plugin
https://tobibeer.github.io/tw5-plugins/#inc
I was looking around for ways to style transcluded tiddlers and found Tobi Beer’s inc plugin.
Instead of the standard {{ Transcluded Tiddler }} syntax, you use this macro instead:
<<{ [[Transcluded Tiddler]]>>
In the macro file, I added the linked name of the transcluded tiddler by adding this line:
<p class="tbinc-title">[[$tiddler$]]</p>
I wanted the transcluded content to look different, so I gave it a background and some padding by editing th…
This includes a header that you can just straight to edit mode.
4 Likes
Thank you @EricShulman . While the plugin @boris mentioned is ready to use, but I liked your solution cause it takes out the magic from plugins.
This is the template that I wrote for my TW.
<style>
.my-navigate-transcluded-tiddler {
float: right;
margin: 0;
padding: 0;
font-size: 0.6em;
display: inline;
text-align: right;
margin-top: -30px;
}
.my-navigate-transcluded-tiddler button {
margin-right: 0;
}
</style>
<div class="tc-page-controls my-navigate-transcluded-tiddler">
<$button class="tc-btn-invisible"
to=<<currentTiddler>>
tooltip={{{ [[view "]addsuffix<currentTiddler>addsuffix["]] }}}>
{{$:/core/images/preview-open}}
</$button>
<$button class="tc-btn-invisible"
message="tm-edit-tiddler" param=<<currentTiddler>>
tooltip={{{ [[edit "]addsuffix<currentTiddler>addsuffix["]] }}}>
{{$:/core/images/edit-button}}
</$button>
</div>
<$transclude mode="block"/>
There is one more plugin that is closely related to the question, besides the one that @boris mentioned.
https://clutterstack.github.io/can-tw/rider-plugin/
1 Like
You may also like Utility/Custom transclusion:
https://kookma.github.io/TW-Utility/#Utility%20Tutorial
It has simple macros to transclude with link:
the content
the code
fields
description
1 Like
EricShulman:
{{HelloThere||EditLink}}
Continuing from this method I have developed an editor toolbar button that allows you to select some text as in this example “HelloThere”, then search for any tiddler such as in this example “EditLink” and click to replace the selection with {{HelloThere||EditLink}}.
This provides an interactive way to view a “tiddler title” through a selected template tiddler. Whilst quite generic in nature, it is then possible to code a smart transclusion template that can do many things, starting with providing the edit link requested in the original topic.
Eg; a title-handler template may be
<$link/><$button tooltip="edit tiddler" message=tm-edit-tiddler param=<<currentTiddler>> class="tc-btn-invisible">^^đź–‰^^</$button>
Click the link to open, click đź–‰ to edit.
However the template can respond to different local or global settings, create new tiddlers with a link to it’s parent, display a tooltip and a lot more.
Draft: transclude-template-button.json (5.0 KB)
2 Likes
boris
September 14, 2022, 7:16am
9
Oh that’s a cool one. Thanks for sharing!