Why?  Why not?

Based off the random filter idea of SS found at TW-Scripts...

It is a tiddler designed to be used in the story river as the main focus 
(for reading), so I haven't seen any issues with it being triggered by 
other wiki activity that would cause a tiddler refresh and a new random 
tiddler display (since it wouldn't be open during any editing).  The 
tiddler gets opened by a button with a tm-navigate message in the top or 
sidebar. The two buttons in the tiddler itself cause a new random tiddler 
to display by writing "Next poem" to a field ( zzdatesort ) of the tiddler 
which it is transcluded in the buttons text, causing a refresh of the 
tiddler and triggering the random filter of the list widget controlling the 
random tiddler display.


\define randpoem()
<$set name=r1 value=<<now 0XXX>>>
<$set name=r2 filter="[<r1>splitregexp:title[]rest[]join[]]" >
<$set name=nth filter="[tag[*poem]count[]multiply<r2>divide[100]ceil[]]">
<$list filter="[tag[*poem]nth<nth>]">
<div style="text-align:center;"><$view field="title"/></div>
<$transclude field="text" mode="block"/>
</$list>
</$set>
</$set>
</$set>
\end
<div><$button set="!!zzdatesort" setTo="Next poem" 
>{{!!zzdatesort}}</$button></div>
<<randpoem>>
<$button set="!!zzdatesort" setTo="Next poem" >{{!!zzdatesort}}</$button>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a409f23c-8afd-42fc-8d89-5f91b29a08e0n%40googlegroups.com.

Reply via email to