Next tiddler by page number

197 views
Skip to first unread message

Dave

unread,
Mar 16, 2016, 11:54:31 PM3/16/16
to TiddlyWiki
apologies ahead of time if this is more of a TiddlywikiDev type problem...

I'm making a TW5 for a presenation, kind of like a TW5 version of powerpoint (which I'll share here once I'm done)



I have this in a viewtemplate for tiddlers with the tag "slide"

<$list filter="[all[current]has[next]]"><div style="float:right;">
<$link to={{!!next}}>next</$link>
</div>
</$list>


What it does is grab the content of the "next" field (which is the name of another tiddler) and when you click "next" it opens whatever tiddler is named in that field



  • Instead, what I'd like to do is have a field called "page" and have a number in it, and when you click "next" it will open whatever tiddler has the next biggest number in the "page" field, whether its 1 digit bigger than that of the current tiddler or 10 digits or whatever.  This way I can reorder my slide presentation by simply changing the page field in any slide tiddler 

Is this possible using the existing tiddlywiki 5 structure, or would it require special coding of some sort?


Thanks, 
Dave

Mat

unread,
Mar 17, 2016, 1:16:18 AM3/17/16
to TiddlyWiki
You might want to check out Matabeles work on listops for a powerpoint type pres.

Regarding counting like that, maybe the help I got from Eric Shulman some week back is of use. I use it in QuickTid to create a new title e.g, New Tiddler (3), based on previous titles. Erics thing is the filters/count.js tiddler and I use it in the main tiddler titled QuickTid (i.e titled same as whole application).

<:-)

Jed Carty

unread,
Mar 17, 2016, 8:08:38 AM3/17/16
to TiddlyWiki
The before and after operators are what you want. If you look at the code in my prototype gallery plug-in you can see an example here http://ooktech.com/jed/ExampleWikis/PetDiary/#%24%3A%2Fplugins%2Finmysocks%2FPhoto%20Gallery%2FgalleryTemplateHeader

Dave

unread,
Mar 17, 2016, 1:09:24 PM3/17/16
to TiddlyWiki
Ok, thank you both. I'll look into those and post back if I get it working.

Matabele

unread,
Mar 17, 2016, 10:54:48 PM3/17/16
to TiddlyWiki
Hi Dave

There's a mechanism for slides on the listops demo site -- this uses the cycle[] operator -- you'll need to copy across the version of the x-listops filters from that site.

The order of the slides may be changed by changing the order of the titles in the list of slides.

regards

Matabele

unread,
Mar 17, 2016, 11:03:19 PM3/17/16
to TiddlyWiki
Hi Dave

If you want to use a tag to list the slides (rather than a list) -- use a filter expression containing the list of tagged tiddlers sorted by the value of an 'order' field -- and adjust values accordingly

"[tag[mytag]sort[myorder]]"

regards

Dave

unread,
Mar 18, 2016, 1:45:02 PM3/18/16
to TiddlyWiki
Hi Matabele,

I'm trying to get your solution working but I must be doing something wrong:

I imported this:
$:/plugins/matabele/slideshow

and I interpreted "copy across the version of the x-listops filters from that site" to mean copy the tiddler "The Extended Listops Filters"

and I made a tiddler called "test" with the field called "filter" with the contents:
[tag[slide]sort[order]]

where I have lots of tiddlers with the tag "slide" and some with the field "order" each with different numbers.

The test tiddler shows up empty though

What am I doing wrong?

Thanks,
Dave

Matabele

unread,
Mar 18, 2016, 2:39:45 PM3/18/16
to TiddlyWiki
Hi Dave

You also need this: $:/core/modules/filters/x-listops.js -- contains the cycle[] filter operator.

$:/plugins/matabele/slideshow isn't a plugin as such -- just the macros and stylesheets used for the two chevron buttons in the demo

You will, therefore, also need to copy over the container tiddler -- and edit the values in its fields to target the tiddlers you wish to cycle through (which it seems you might have done already.)

regards

Dave

unread,
Mar 18, 2016, 4:23:00 PM3/18/16
to TiddlyWiki
Thank you for your assistance.  I got it working now.

I'd like to slightly change the behaviour to open new tiddlers (in zoomin mode) when you click back or next for a more immersive experience, instead of having a containing tiddler with the slides shifting within that tiddler.  Ideally the chevrons would appear at the bottom of each new slide tiddler (but not in tiddlers that don't have the tag "slide")

Do you think that would be difficult to acheive with your setup?

Dave

unread,
Mar 18, 2016, 6:42:28 PM3/18/16
to tiddl...@googlegroups.com
Actually, nevermind.

I got it to work by tweaking Jed's Pet Diary example tagged as "$:/tags/ViewTemplate"

Yay!  Thank you all :)

<$list filter='[is[current]]+[tag[slide]]+[nsort[order]]' variable=CurrentImage>

<div style='width:100%'>
<$list filter='[nsort[order]]+[before
<CurrentImage>]'>
<div style='width:70%;z-index:99;position:absolute'>
<$button class='tc-btn-invisible'>
<$action-navigate $to=<
<currentTiddler>>/>{{$:/core/images/chevron-left}}
<$action-sendmessage $message='tm-close-tiddler' $param=<
<CurrentImage>>/>
</$button>
</div>
</$list>
<$list filter='[nsort[order]]+[after
<CurrentImage>]'>
<div style='text-align:right;position:absolute;width:80%;z-index:98'>
<$button class='tc-btn-invisible'>
<$action-navigate $to=<
<currentTiddler>>/>{{$:/core/images/chevron-right}}
<$action-sendmessage $message='tm-close-tiddler' $param=<
<CurrentImage>>/>
</$button>
</div>
</$list>

</div>
<br>

<div>
<p>
<$transclude field='caption' mode=block/>
</p>
<br>
</div>
</$list>


Reply all
Reply to author
Forward
0 new messages