Append tiddlers to bottom of river, instead of top

Hi. I have a tab that lists the 12 newest tiddlers in my wiki. It has a button that uses the $action-navigate widget to open all of them at once in the river. In this instance, I would like them to be added to the river at the bottom, beneath the tiddlers that are already open. Is this possible?

Alternatively, I thought I might modify the button that opens the 12 newest tiddlers to make it “close all” and then re-populate the river with the content of $:/DefaultTiddlers + the 12 newest tiddlers, so I can have the order I want. But I’m not sure how to transclude the DefaultTiddler tiddler links into something the “to” attribute on the $action-navigate widget can operate.

If that makes sense.

Try these:

<$button> add 12 most recent tiddlers to the end of the Story River
<$set name="recent" filter="[all[tiddlers]!is[system]limit[12]!sort[modified]]">
<$set name="newStoryList" filter="[enlist{$:/StoryList!!list}] [enlist<recent>]">
<$action-setfield $tiddler="$:/StoryList" list=<<newStoryList>>/>
</$set>
</$set>
</$button>

<$button> close all, open $:/DefaultTiddlers and 12 most recent tiddlers
<$set name="recent" filter="[all[tiddlers]!is[system]limit[12]!sort[modified]]">
<$set name="newStoryList" filter="[subfilter{$:/DefaultTiddlers}] [enlist<recent>]">
<$action-setfield $tiddler="$:/StoryList" list=<<newStoryList>>/>
</$set>
</$set>
</$button>

Notes:

  • The first $set widget gets the list of 12 most recent tiddlers, sorted newest first.
  • The second $set widget prepends either the current Story River contents ($:/StoryList!!list) or the $:/DefaultTiddlers list.
  • The $action-setfield widget updates the $:/StoryList!!list field, which triggers a refresh of the Story River contents.
  • The contents of $:/DefaultTiddlers can contain filter syntax, not just a simple list of tiddler titles. Thus, we use subfilter{$:/DefaultTiddlers} to get the actual list of titles.
  • In the second example, we don’t actually need to explicitly close the current open tiddlers, since we are completely replacing the value in $:/StoryList!!list, so only those tiddlers will be displayed.

enjoy,
-e

2 Likes

This makes me think some Page Control buttons to sort the story by name, created, modified could be helpful, or a open tiddlers by filter including sort would be nice.

2 Likes

Thank you so much! This is a lot to play with. Especially the “enlist” operator. I really appreciate the lift.

I agree, sorting would be cool. Also, because depending on where I put this button, if the open tiddler list is not visible, it is not apparent when it is clicked that anything has changed. I ended up instructing the button to also change the displayed tab to the open tiddlers list, but it got me thinking, it would be neat to have a “minimap” or page map feature:

[pagemap demo - text]

I mean this is what the open tiddlers list already does. It would just be interesting to have an additional visual map of the River. :slight_smile:

This may be quite simple as we already use $:/core/ui/PageTemplate/story to display all open tiddlers, if someone could make mini image of this that pops up it would be similar. Of course it renders all tiddlers open in the story so not so good if you have a lot open.

@Mohammad could do this because he did some nice miniature tiddler previews in the past for a slideshow tool.

The main question I imagine is where is it displayed? Perhaps on hover over the wiki title.