Alternative Page Layout and Story and History Tiddlers

Based on Alternative page layouts documents, it seems $:/StoryList and $:/History are hardcoded for example see tm-home. Am I right? If no, how one can use customized story and history tiddlers?

References

Hey Mohammad,

They are set within the pageTemplate for a given layout. That page will have two widgets: the <$navigator> and a <$list> widget nested within that. These two will have matching values for the history parameter and a match in the story parameter for the navigator and the filter parameter for the list widget.

So for example the standard layout has a tiddler $:/core/ui/PageTemplate with the following:

<$navigator story="$:/StoryList" history="$:/HistoryList" ...

and via a flexible transclusion of sub components you get the tiddler $:/core/ui/PageTemplate/story that has

<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" ...

So everything that sits inside the navigator widget (including everything that is transcluded) that can send a tm-message like the link widgets and toolbar buttons (like close others) … is essentially sending those messages to the navigator widget. The navigator widget then changes the story or history lists accordingly. Once changed the list widget that is providng the story river is refreshed with the changes ( such as added tiddlers from a link or removed tiddlers from a close all button)

You can change these two values $:/StoryList and $:/HistoryList to anything in your implementation as long as you keep them the same for both the navigator and list widget.

Cheers
CB

2 Likes

Hi @Mohammad there are a number of places in the core where $:/StoryList and $:/HistoryList are hardcoded. The tm-home message handling could be updated with additional parameters for specifying the titles of those tiddlers, but we’d also need to update the navigator widget and handling of other messages.

In any case, it is quite possible that the more interesting alternative page layouts might use a completely different system for managing the displayed tiddlers, and not be constrained by the existing navigation architecture.

1 Like

@jeremyruston pointed out. Not only the TW templates have hardcoded values. Also the core-code at the moment used those default values in a hardcoded way.

Anyway. The <$navigator widget does set 2 global variables:

  • tv-story-list and
  • tv-history-list

that can be used by TW templates.

ATM the navigator-widget does not listen to those variables, which could be set by TW navigation events.

I did some experiments using the link-catcher widget and allowed it to send any variable to the navigator. This allowed me to avoid modifying any other core widget.


The problem with tm-home is, that it is “hardcoded” to the story.js code. So it basically bypasses the navigator completely.

1 Like