Bob,
I expect Erics solution will be full featured and more generic. I will
however post my work in progress. I discovered Eric had answered while I
was building a solution.
Since you provided the link to the wiki, I was able to build something
knowing how the data was structured. Three different solutions are below
(With a minor bug I will fix if desired)
Place *one of these* in a tiddler tagged $:/tags/ViewTemplate and use the
tag pill `<<tag $:/tags/ViewTemplate>>` to change the order and where the
controls appear.
Simple
<$list filter="[all[current]prefix[Page ]removeprefix[Page ]]"
variable=page-number>
{{{ [<page-number>subtract[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}} here {{{ [<page-number>add[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}}
</$list>
Buttons
<$list filter="[all[current]prefix[Page ]removeprefix[Page ]]"
variable=page-number>
<$button to={{{
[<page-number>subtract[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}} tooltip="last page">{{$:/core/images/left-arrow}} </$button>
<$button to= {{{
[<page-number>add[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}} tooltip="next page">{{$:/core/images/right-arrow}} </$button>
</$list>
Buttons with First and hard coded Last page as well
<$list filter="[all[current]prefix[Page ]removeprefix[Page ]]"
variable=page-number>
<$button to="Page 001" tooltip="First
page">|{{$:/core/images/chevron-left}}</$button>
<$button to={{{
[<page-number>subtract[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}}>{{$:/core/images/left-arrow}}</$button>
<$button to= {{{
[<page-number>add[1]divide[1000]removeprefix[0.]addprefix[Page
]] }}}>{{$:/core/images/right-arrow}}</$button>
<$button to="Page 181" tooltip="Last
page">{{$:/core/images/chevron-right}}|</$button>
</$list>
However previous does not work over 99, I will find a solution if you want,
just ask.
- This is because your pages have leading zeros that need to be handled.
This solution does not close the previous like Eric does (I Think) however
Control Panel > Appearance > Story View > Zoomin does something similar.
- A range of other possibilities are available via the page tag you have
used.
Regards
Tony
On Thursday, July 23, 2020 at 3:19:08 PM UTC+10, Bob Jansen wrote:
>
> I have a tiddlywiki file with 170 'pages' of information. Each tiddler
> corresponds to a physical page in a book. I would like a button to allow
> the user to 'turn the page', next or previous, without having to type its
> title into the search bar. Pages have a title of 'Page 001', 'Page 002',
> etc.
>
> I have been searching for how to do this but can not find a way at
> present. I have gone through the info on macros, Lists, Mathematical
> functions and each offers a glimpse which quickly peters out.
>
> Any one got any pointers?
>
>
> http://cultconv.com/English/Conversations/MacQueen_Mary/TiddlyWiki/index.html
>
> bobj
>
>
--
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/9d008f9f-01ca-4395-a31b-85100c169853o%40googlegroups.com.