[[TW5]] Storys plugin. Saving StoryList to a field. Saving a History snapshot.

76 views
Skip to first unread message

Jason Davidson

unread,
Jul 6, 2015, 7:15:05 PM7/6/15
to tiddl...@googlegroups.com

Firstly may I say thank you for Tiddlywiki. It is awesome!

I have been trying to modify the Stories plugin / Saving a History Snapshot from tb5 and also from the original thread on this forum. 

I want to attach the StoryList to a field on the actual Journal tiddler rather than a separate hidden tiddler. The story I wish to save will always relate to a Journal tiddler thus it seemed sensible to try and combine them.

Using the below code I have managed to get the StoryList written to a field and also to reload the story list. It works.

Where it fails however is when writing StoryList to the field whilst in Edit mode. Instead of writing the name of the current tiddler as it will be when saved it writes:

"[[Draft of SuchandSuchTiddler]]"

Thus when you reload the StoryList an undefined Tiddler called "[[Draft of SuchandSuchTiddler]]" is created rather than loading "SuchandSuchTiddler"

Is there any way around this behaviour?

Finally, if there is a better way I would love to hear it as I really am a beginner at this.

Many thanks in advance.

---

The code in the Tiddler:

\define getLink(title) [[$title$]]

\define loadSnapshot()
<$button
set="$:/StoryList!!list"
setTo
={{!!XSStoryList}}>
{{$:/core/images/right-arrow}}
Load Workflow</$button>
\end

\define saveSnapshot()
<$button
set="!!XSStoryList"
setTo={{$:/
StoryList!!list}}>
{{$:/core/images/done-button}}
Save Workflow</$button>
\end

<style>
.story-manager button,
.story-manager input,
.story-manager select{
width:150px;
display:inline-block;
text-align:left;
}

.story-manager div {
margin-top:10px;
}
</
style>

<div class="story-manager">
<<saveSnapshot >>
<<loadSnapshot>>
</div>


Reply all
Reply to author
Forward
0 new messages