I am trying to use TiddlyWiki to create a database of exercises.  The 
database includes descriptions on how to prepare for and execute an 
exercise, with corresponding videos for the preparation and execution 
movements.

My current intention is for each exercise tiddler to open with a thumbnail 
image of the exercise along with two buttons that will allow the user to 
view either the preparation or execution videos. In each case, the 
thumbnail image (or video) should be replaced with the preparation or 
execution video of the respective button when selected.

I have created the tiddler template below to include the videos in each 
exercise tiddler, and it pretty much does what I want, except for one 
problem, which I don't know how to solve.

What I would like to happen is that when the exercise tiddler is closed and 
reopened, the tiddler returns to the original state of showing the 
thumbnail image.  However, as I need to use a field or tiddler to store the 
button/reveal state, when I reopen an exercise tiddler it uses the last 
state value that was set.

Is there a way to use variables for this purpose or to reset a tiddler 
field when a tiddler is closed? Alternatively, is there a better way to 
solving my problem?

<$button><$action-setfield $tiddler="$:/exw/state/video" 
$value="prep"/>Preparation</$button>
<$button><$action-setfield $tiddler="$:/exw/state/video" 
$value="exec"/>Execution</$button>
<$reveal type="nomatch" state="$:/exw/state/video" text="image">
<$button><$action-setfield $tiddler="$:/exw/state/video" 
$value="image"/>Reset</$button>
</$reveal>

<$reveal type="match" state="$:/exw/state/video" text="prep">
<video width={{$:/exw/setting/video-size}} autoplay src=
{{!!video-preparation}}/>
</$reveal>
<$reveal type="match" state="$:/exw/state/video" text="exec">
<video width={{$:/exw/setting/video-size}} autoplay loop src=
{{!!video-execution}}/>
</$reveal>
<$reveal type="match" state="$:/exw/state/video" text="image">
<$image width={{$:/exw/setting/video-size}} source={{!!image}}>
</$reveal>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0aa11099-db29-4cb2-8be0-94ec0b88ab9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to