1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-29 19:40:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/howtos/Creating SubStories.tid

32 lines
1.6 KiB
Plaintext
Raw Normal View History

2014-02-14 22:22:41 +00:00
created: 20140214215718317
modified: 20211127032217828
2014-09-19 16:18:25 +00:00
tags: Learning
2014-02-14 22:22:41 +00:00
title: Creating SubStories
type: text/vnd.tiddlywiki
This example shows how to create a sub-story within a tiddler that is independent of the main [[story|Story River]]. The NavigatorWidget and ListWidget work together to:
2014-02-14 22:22:41 +00:00
# Add tiddlers to the [[story|Story River]] when links are clicked. Navigate to the tiddler corresponding to the link click. (''story'' attribute of the NavigatorWidget)
# Remove tiddlers from the [[story|Story River]] when tiddler close buttons are clicked. (''story'' attribute of NavigatorWidget)
# Animate the opening and closing of tiddlers. (''storyview'' attribute of the ListWidget)
# Display the list of open tiddlers. (''filter'' and ''template'' attributes of the ListWidget)
# Display tiddlers in [[draft mode|DraftMechanism]]. (''editTemplate'' attribute of the ListWidget)
# Track [[navigation history|HistoryMechanism]]. (''history'' attribute of both NavigatorWidget and ListWidget)
# And more!
2014-02-14 22:22:41 +00:00
Here is the example code (see also StateMechanism for related discussion):
2014-02-14 22:22:41 +00:00
<$macrocall $name='wikitext-example-without-html'
src='<$navigator story="$:/temp/DemoStoryList" history="$:/temp/DemoHistoryList">
2014-02-14 22:22:41 +00:00
{{$:/core/ui/SideBarSegments/search}}
2014-04-03 17:10:54 +00:00
<$list
filter="[list[$:/temp/DemoStoryList]]"
history="$:/temp/DemoHistoryList"
template={{$:/config/ui/ViewTemplate}}
editTemplate={{$:/config/ui/EditTemplate}}
storyview="classic"
emptyMessage="Use search box above. Clicked search links will open here instead of in the main story.<p>No search ideas? Click this link to get started: HelloThere</p>"/>
2014-02-14 22:22:41 +00:00
</$navigator>'>