Is there a way to make the info button from the View Toolbar appear even when a tiddler is being edited?

One possible solution is to located the tiddler where the button is implemented and tag it with $:/tags/EditToolbar (Edit Toolbar being the name in Control Panel for the toolbar with only Save, Discard and Close that appears in the View Toolbar’s place when a tiddler is being edited, in the).

But I don’t know which tiddler exactly is it.

the tid with the info button code is $:/core/ui/Buttons/info

Tagging that with $:/tags/EditToolbar does indeed make it show up in the controls when in edit mode. However, it doesn’t do anything. It may be that the tid with the info pane contents needs to be tracked down and tagged by something also, but at first look, that eludes me.

2 Likes

You will need to change quite some elements.

I did create a Field Editor plugin, which shows the tiddler info button in edit mode.

You can have a look at it. I was developed for something different so it may not work for you, but you can use it as a template.

The intro can be found at: [Intro] Multiline Field Editor Plugin
-mario

1 Like

As @pmario said, you need a few additional steps to get this working. Here’s a downloadable package with the necessary changes implemented: edit mode info panel.json (5.7 KB)

Contents:

  1. EditTemplateInfo (a new EditTemplate segment; rename as you like)
  2. $:/core/ui/EditTemplate
  3. $:/core/ui/Buttons/info

Warning: This approach modifies two core tiddlers! If you upgrade your wiki in the future, any changes to the shadow versions of these tiddlers will be “masked” by the modified tiddlers, so you’ll need to make any necessary changes manually (or delete the modified tiddlers if you no longer want them). I recommend installing @twMat’s Overwrite plugin to keep track of any changes you’ve made to the core.

  • $:/core/ui/Buttons/info - added the tag $:/tags/EditToolbar, as @nemo suggested
  • $:/core/ui/EditTemplate - added a variable definition to the $vars widget:
tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>

You can view this change in the preview window by setting the preview mode to “differences from shadow (if any)”:

We need this more “invasive” change because the button $:/core/ui/Buttons/info works by setting the value of a state tiddler whose title is defined by the variable <<tiddlerInfoState>>. In the core, this variable is defined in $:/core/ui/ViewTemplate in the following line:

<$vars storyTiddler=<<currentTiddler>> tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>

You’ll notice that <<tiddlerInfoState>> is defined using the qualify macro, which appends a string of numbers to the specified prefix to generate a unique-but-reproducible title based on its position in the stack of transcluded tiddlers.

  • This means that if you used the same definition, <$vars tiddlerInfoState=<<qualify "$:/state/popup/tiddler-info">>>, in $:/core/ui/ViewTemplate and in $:/core/ui/Buttons/info, you’d get a different value for each.
  • Thus, we need to insert the <<qualify ...>> definition directly into $:/core/ui/EditTemplate to ensure that it will have the same value everywhere in the EditTemplate (including all the buttons and $:/tags/EditTemplate segments that the EditTemplate transcludes).

Finally, I went back to Advanced Search and discovered that the <<tiddlerInfoState>> variable is also used by a $reveal widget in $:/core/ui/ViewTemplate/title to display the info panel when the info button is clicked (thereby setting the state tiddler):

	<$reveal tag="div" type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tc-tiddler-info tc-popup-handle" animate="yes" retain="yes">
		<$list filter="[all[shadows+tiddlers]tag[$:/tags/TiddlerInfoSegment]!has[draft.of]] [[$:/core/ui/TiddlerInfo]]" variable="listItem">
			<$transclude tiddler=<<listItem>> mode="block"/>
		</$list>
	</$reveal>

Unfortunately, this $reveal is hard-coded into the the title segment of the ViewTemplate, so we can’t easily use the $:/tags/EditTemplate tag to add it to the EditTemplate. So instead, I copied the above code (plus its parent <div>) into a new tiddler, EditTemplateInfo, and gave that the $:/tags/EditTemplate tag.

Finally, I added the field list-after: $:/core/ui/EditTemplate/title to force my new EditTemplate segment to appear directly beneath the title, as the info panel does in the ViewTemplate.

  • This last step is semi-optional: if you’d rather have the panel elsewhere, you can remove the list-after field and drag EditTemplateInfo in the $:/tags/EditTemplate tag-pill dropdown to reposition it relative to the other edit-mode segments.

Have fun!

4 Likes

Thank you and @pmario very much.