That’s it. You should now have a new “insert bookmark” EditorToolbar button. When clicked, it will show the MiniBrowser’s “folders_find” interface with an input field to find matching bookmarks, and a list showing the matching bookmarks. Clicking on a bookmark inserts that bookmark’s [[Title|url]] into the tiddler being edited.
After testing on TiddlyWiki.com, I realized that my initial solution was not consistent with the standard EditorToolbar implementation methods. Here’s the new method:
Create a tiddler (e.g., “TiddlyTools/Panels/Browser/InsertBookmark”), tagged with $:/tags/EditorToolbar, with the following fields:
The dropdown field value is now just TiddlyTools/Panels/Browser/InsertBookmark, instead of TiddlyTools/Panels/Browser/InsertBookmark/dropdown
findid uses the <<dropdown-state>> tiddler to hold the “find a name or URL” input. By using this transient $:/state/popup tiddler (which is created by the TWCore’s EditorToolbar handling), the input is automatically reset when the dropdown is dismissed.
The [<transclusion>search[|text|]] conditional is TRUE when showing the EditorToolbar button, but FALSE when showing the dropdown. This is what allows the same tiddler definition show either the button or the dropdown.
Where and however you get the link from the json you could also copy it to the clipboard to allow pasting multiple times, however I would encourage a designer of such solutions storing the result in a temporary tiddler as well allowing tiddlywiki buttons to access effectively a wiki clipboard.
It is great. For straightforward links it works really, really well! And a doddle! Thanks.
Seeing it working I realized that inserting the links I will eventually need to cope with authoring web pages—whose final use will not be in a TW—I will probably need a second editor inserter of links in raw HTML format?
I’m trying to find an example to illustrate the issue clearly. A dopo.
To generate external HTML links, clone TiddlyTools/Panels/Browser/InsertBookmark (e.g., TiddlyTools/Panels/Browser/InsertHTMLBookmark) and replace this:
That one really helped me understand how to create bespoke Bookmark inserters. I managed to make a third inserter for in-Tiddler skeletons for “ID jumps” …