Scroll tiddler to top in edit / draft mode

I have a simple button.

<$list filter="[<currentTiddler>]" variable="ABC">
<$button to=<<currentTiddler>>>tiddler top</$button>
</$list>

It will scroll a (system) tiddler to the top. The button is placed at the bottom of all (system) tiddlers through the $:/tags/ViewTemplate tag. This way I can click the button and go to the top of the tiddler the easy way.

It would be nice to have such a button available in “draft mode” as well. But I have no idea how to achieve this.

Does anyone know how to do this?

Just add $:/tags/EditTemplate to the tiddler containing the “tiddler top” $button. When in “draft mode”, the value of <<currentTiddler>> is set to Draft of 'SomeTiddlerTitle', so your existing $button navigation works there as well.

Also, please explain why you’ve enclosed the $button widget within a $list widget. My guess is that you are trying to ensure that currentTiddler is defined before using it in the $button widget. However, it shouldn’t be necessary since both $:/tags/ViewTemplate and $:/tags/EditTemplate are only applied to tiddlers displayed in the StoryRiver, where currentTiddler is ALWAYS defined.

-e

1 Like

Ah ok, That is surprisingly simple. Thanks!

It is a clone of an existing template I have, intended for system tiddlers, that has a bit more to it. Also, I did not know about currentTiddler in the StoryRiver indeed.

→ adapted that template accordingly

Cheers!