Defining navigation paths in TiddlyWiki5

474 views
Skip to first unread message

James Weaver

unread,
Nov 27, 2013, 4:05:38 PM11/27/13
to tiddl...@googlegroups.com
The use case that drove me to investigate TiddlyWiki5 is the following:

Student wants to learn about a given topic (e.g. music theory) and visits a TiddlyWiki that has content on the subject of interest.  
A tiddler asks the student to select a sub-topic of interest (e.g. circle of fifths), perhaps via a concept map. 
The student is presented with the first twiddler (zoomin mode) in a pedagogically-arranged subset of the twiddlers (created by a subject matter expert) in the music theory TiddlyWiki.  
  - Each twiddler contains a small amount of learning content, such as a video, image and text, quiz questions, and external links
  - Arrows on each twiddler (perhaps wizard-like navigation) would navigate the use through the predefined path.
  - When the student navigates past the last twiddler in the path, the concept map twiddler appears

All of this is available in learning management systems like Moodle, but the elegant simplicity of TiddlyWiki5 would lend itself well to this use case, both from teacher and student perspectives.

So, being a TiddlyWiki newbie, my questions are:

1) Can a graphic on a twiddler contain links (i.e. hot spots) to other twiddlers?
2) Can a path through a subset of twiddlers be defined through which Prev/Next buttons on each of twiddlers would navigate?

Thanks,
Jim Weaver

PMario

unread,
Nov 27, 2013, 6:40:48 PM11/27/13
to tiddl...@googlegroups.com
I think TiddlyWiki5 will work perfectly well for your usecase.

David Johnston did some filter extensions, that may be interesting. See his introduction at http://www.youtube.com/watch?feature=player_detailpage&v=DZiU4uSGFnQ#t=355
Since Jeremy did some refactoring, David will need to make some adjustments to his plugins.

-m

PMario

unread,
Nov 27, 2013, 7:03:25 PM11/27/13
to tiddl...@googlegroups.com

James Weaver

unread,
Nov 27, 2013, 8:53:24 PM11/27/13
to tiddl...@googlegroups.com
Thanks.  Being new to this, I'm not sure what the best next step to take to implement David's ideas.  For example, should I create a data twiddler that expresses the twiddlers that are in the desired path?

Regards,
Jim

Eric Shulman

unread,
Nov 27, 2013, 9:29:39 PM11/27/13
to tiddl...@googlegroups.com
On Wednesday, November 27, 2013 5:53:24 PM UTC-8, James Weaver wrote:
...twiddler ... twiddlers

Just a (very) minor note...  it's "tiddler" and "tiddlers" ... no W.

Welcome to the community!

:)


enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

EVERY DONATION IS IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

James Weaver

unread,
Nov 27, 2013, 11:10:18 PM11/27/13
to tiddl...@googlegroups.com
Thanks Eric.  Any thoughts on my "next step" question?

Regards,
Jim

PMario

unread,
Nov 28, 2013, 9:43:24 AM11/28/13
to tiddl...@googlegroups.com
On Thursday, November 28, 2013 2:53:24 AM UTC+1, James Weaver wrote:
Thanks.  Being new to this, I'm not sure what the best next step to take to implement David's ideas.  For example, should I create a data twiddler that expresses the twiddlers that are in the desired path?

You'll need to wait, until Daivd did adjust his plugins, so you can use them with the latest TW5. But be aware, TW5 is close to beta, but there will be some changes that _may_ cause some additional work on your side. ....
 
Tagging will be used to create the lists, that should be a "story". The internal list field will be used to sort them in the order you need it. So you may get a "next/previous" button and the other cool stuff David mentioned in his intro viedeos.

I don't know if David Johnston is listening here?!

-mario

James Weaver

unread,
Nov 28, 2013, 10:44:33 AM11/28/13
to tiddl...@googlegroups.com
Thanks Mario!  I plan on attending the upcoming google hangout by the way.

@David: I'm interested in your thoughts/plans on the subject, so please do reply.

Thanks,
Jim

Jeremy Ruston

unread,
Nov 28, 2013, 11:02:18 AM11/28/13
to TiddlyWiki
The next and previous filters that David wrote are now in the core, and so are available to use.

They work in association with the 'list' field, which is interpreted as a space-separated list of tiddler titles (using double square brackets to quote titles that contain a space). The next and previous filters both work in a similar way that's easiest to show with an example.

Let's say you have a tiddler called "Lesson1" with the "list" field set to:

[[First Bit]] SecondBit FinalBit

You'll also need to create the named tiddlers.

Then, create a new tiddler called "Navigation" with the tag "$:/tags/ViewTemplate" and the following content:

Next: <$list filter="[is[current]next[Lesson1]]"/> / Previous: <$list filter="[is[current]previous[Lesson1]]"/>

Now if you open a tiddler like "SecondBit" you should see at the bottom the controls to move to the next and previous tiddlers.

The next and previous filter operators work by locating the currently selected tiddler(s) in the named list, and returning the adjacent next or previous tiddler from the list.

Best wishes

Jeremy.





--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Eric Shulman

unread,
Nov 28, 2013, 12:20:16 PM11/28/13
to tiddl...@googlegroups.com, jeremy...@gmail.com
On Thursday, November 28, 2013 8:02:18 AM UTC-8, Jeremy Ruston wrote:
The next and previous filters that David wrote are now in the core, and so are available to use.
They work in association with the 'list' field, which is interpreted as a space-separated list of tiddler titles (using double square brackets to quote titles that contain a space). The next and previous filters both work in a similar way that's easiest to show with an example.

There are some error use cases I wonder about:

Let's say you have a tiddler called "Lesson1" with the "list" field set to:
[[First Bit]] SecondBit FinalBit
You'll also need to create the named tiddlers.

What happens if a tiddler named in the list does not exist?
 
Then, create a new tiddler called "Navigation" with the tag "$:/tags/ViewTemplate" and the following content:
Next: <$list filter="[is[current]next[Lesson1]]"/> / Previous: <$list filter="[is[current]previous[Lesson1]]"/>

What does the filter produce if the "Lesson1" tiddler is missing or the list field is empty?

Now if you open a tiddler like "SecondBit" you should see at the bottom the controls to move to the next and previous tiddlers.
The next and previous filter operators work by locating the currently selected tiddler(s) in the named list, and returning the adjacent next or previous tiddler from the list.

What if the same tiddler title in the named list more than once...  which occurence does the filter match as the "current selected tiddler"?
What does the [[Navigation]] template display if the current tiddler is not in the list at all?
When you reach the start/end of the list, does it loop around to the end/start, or just stop?
If navigation doesn't loop, when you reach the start/end, can display of non-functional links be suppressed?
Will there also be a [first[Lesson1]] and [last[Lesson1]] so a complete "FPNL" (First/Previous/Next/Last) navigation bar can be displayed?

enjoy,
-e
 

Jeremy Ruston

unread,
Nov 28, 2013, 12:43:25 PM11/28/13
to Eric Shulman, TiddlyWiki
Hi Eric

There are some error use cases I wonder about:

Let's say you have a tiddler called "Lesson1" with the "list" field set to:
[[First Bit]] SecondBit FinalBit
You'll also need to create the named tiddlers.

What happens if a tiddler named in the list does not exist?

Nothing; the tiddlers named in the list don't need to exist.
 
 
Then, create a new tiddler called "Navigation" with the tag "$:/tags/ViewTemplate" and the following content:
Next: <$list filter="[is[current]next[Lesson1]]"/> / Previous: <$list filter="[is[current]previous[Lesson1]]"/>

What does the filter produce if the "Lesson1" tiddler is missing or the list field is empty?

If the list tiddler doesn't exist then the next and previous filter operators always return an empty list.
 

Now if you open a tiddler like "SecondBit" you should see at the bottom the controls to move to the next and previous tiddlers.
The next and previous filter operators work by locating the currently selected tiddler(s) in the named list, and returning the adjacent next or previous tiddler from the list.

What if the same tiddler title in the named list more than once...  which occurence does the filter match as the "current selected tiddler"?

Currently it would return the entries adjacent to the first instance of the current tiddler.
 
What does the [[Navigation]] template display if the current tiddler is not in the list at all?

At the moment it still displays the Next: and Previous: text with no accompanying links.

We need a way for the reveal widget to hide or show content depending on whether a filter evaluates to zero or more entries.

When you reach the start/end of the list, does it loop around to the end/start, or just stop?

It stops at each end of the list.
 
If navigation doesn't loop, when you reach the start/end, can display of non-functional links be suppressed?

No links are displayed at the ends of the list.
 
Will there also be a [first[Lesson1]] and [last[Lesson1]] so a complete "FPNL" (First/Previous/Next/Last) navigation bar can be displayed?

Good idea, there should be. I've created a ticket:


Best wishes
 

enjoy,
-e
 

James Weaver

unread,
Nov 28, 2013, 11:46:03 PM11/28/13
to tiddl...@googlegroups.com, Eric Shulman, jeremy...@gmail.com
Thanks Jeremy, et al., for your help.  This indeed works (see attached screenshot) and I'd like to ask a couple more questions (see inline).

Thanks again,
Jim Weaver


On Thursday, November 28, 2013 12:43:25 PM UTC-5, Jeremy Ruston wrote:
Hi Eric

There are some error use cases I wonder about:

Let's say you have a tiddler called "Lesson1" with the "list" field set to:
[[First Bit]] SecondBit FinalBit
You'll also need to create the named tiddlers.

What happens if a tiddler named in the list does not exist?

Nothing; the tiddlers named in the list don't need to exist.
 
 
Then, create a new tiddler called "Navigation" with the tag "$:/tags/ViewTemplate" and the following content:
Next: <$list filter="[is[current]next[Lesson1]]"/> / Previous: <$list filter="[is[current]previous[Lesson1]]"/>

What does the filter produce if the "Lesson1" tiddler is missing or the list field is empty?

If the list tiddler doesn't exist then the next and previous filter operators always return an empty list.
 

Now if you open a tiddler like "SecondBit" you should see at the bottom the controls to move to the next and previous tiddlers.
The next and previous filter operators work by locating the currently selected tiddler(s) in the named list, and returning the adjacent next or previous tiddler from the list.

What if the same tiddler title in the named list more than once...  which occurence does the filter match as the "current selected tiddler"?

Currently it would return the entries adjacent to the first instance of the current tiddler.
 
What does the [[Navigation]] template display if the current tiddler is not in the list at all?

At the moment it still displays the Next: and Previous: text with no accompanying links.

We need a way for the reveal widget to hide or show content depending on whether a filter evaluates to zero or more entries.

Is that something I can do through modifying the list filter, or would something need to be modified in the core?

Also, would it be possible using the current version (5.0.0-alpha.16-prerelease) for me to create Previous and Next buttons that, when clicked, navigate to the desired tiddlers?  The Previous button would need to be disabled or not visible when on the first tiddler, and the Next button would need to be disabled when on the final tiddler.

Screen Shot 2013-11-28 at 11.33.58 PM.png

Jeremy Ruston

unread,
Nov 29, 2013, 2:31:39 AM11/29/13
to James Weaver, TiddlyWiki, Eric Shulman
Hi Jim
 

We need a way for the reveal widget to hide or show content depending on whether a filter evaluates to zero or more entries.

Is that something I can do through modifying the list filter, or would something need to be modified in the core?

Adding that variant of the reveal widget is a modification that needs to be made to the core.
 
Also, would it be possible using the current version (5.0.0-alpha.16-prerelease) for me to create Previous and Next buttons that, when clicked, navigate to the desired tiddlers?  The Previous button would need to be disabled or not visible when on the first tiddler, and the Next button would need to be disabled when on the final tiddler.

Isn't that what the example above does? We use links rather than buttons because in TW5 buttons are for actions and links are for navigation.

Best wishes

Jeremy
 


When you reach the start/end of the list, does it loop around to the end/start, or just stop?

It stops at each end of the list.
 
If navigation doesn't loop, when you reach the start/end, can display of non-functional links be suppressed?

No links are displayed at the ends of the list.
 
Will there also be a [first[Lesson1]] and [last[Lesson1]] so a complete "FPNL" (First/Previous/Next/Last) navigation bar can be displayed?

Good idea, there should be. I've created a ticket:


Best wishes
 

enjoy,
-e
 



--
Jeremy Ruston
mailto:jeremy...@gmail.com

James Weaver

unread,
Nov 29, 2013, 8:47:24 AM11/29/13
to tiddl...@googlegroups.com, James Weaver, Eric Shulman, jeremy...@gmail.com


On Friday, November 29, 2013 2:31:39 AM UTC-5, Jeremy Ruston wrote:
Hi Jim
 

We need a way for the reveal widget to hide or show content depending on whether a filter evaluates to zero or more entries.

Is that something I can do through modifying the list filter, or would something need to be modified in the core?

Adding that variant of the reveal widget is a modification that needs to be made to the core.
 
Also, would it be possible using the current version (5.0.0-alpha.16-prerelease) for me to create Previous and Next buttons that, when clicked, navigate to the desired tiddlers?  The Previous button would need to be disabled or not visible when on the first tiddler, and the Next button would need to be disabled when on the final tiddler.

Isn't that what the example above does? We use links rather than buttons because in TW5 buttons are for actions and links are for navigation.

Yes, that is the behavior, and I now understand the role of buttons vs. links in TW5.  Thanks Jeremy.

Måns

unread,
Jan 22, 2014, 3:13:49 AM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy

I want the previous next function only to be visible in relevant tiddlers. 
Now it is added to the viewtemplate of all tiddlers. 
Is there a "hide- or showwhen" function which will hide/show the navigation panel from tiddlers based on tags - or sth. like that...?

Cheers Måns Mårtensson

Jeremy Ruston

unread,
Jan 22, 2014, 3:32:51 AM1/22/14
to Måns, TiddlyWiki
Hi Måns

I want the previous next function only to be visible in relevant tiddlers. 
Now it is added to the viewtemplate of all tiddlers. 
Is there a "hide- or showwhen" function which will hide/show the navigation panel from tiddlers based on tags - or sth. like that...?

Yes, although the syntax is currently a little clumsy:

<$list filter="[is[current]tag[myBrilliantTag]]">
Content here will only be displayed if the current tiddler has the tag "myBrilliantTag"
</$list>

Best wishes

Jeremy
 

Cheers Måns Mårtensson

Den torsdag den 28. november 2013 18.20.16 UTC+1 skrev Eric Shulman:
On Thursday, November 28, 2013 8:02:18 AM UTC-8, Jeremy Ruston wrote:
The next and previous filters that David wrote are now in the core, and so are available to use.
They work in association with the 'list' field, which is interpreted as a space-separated list of tiddler titles (using double square brackets to quote titles that contain a space). The next and previous filters both work in a similar way that's easiest to show with an example.

There are some error use cases I wonder about:

Let's say you have a tiddler called "Lesson1" with the "list" field set to:
[[First Bit]] SecondBit FinalBit
You'll also need to create the named tiddlers.

What happens if a tiddler named in the list does not exist?
 
Then, create a new tiddler called "Navigation" with the tag "$:/tags/ViewTemplate" and the following content:
Next: <$list filter="[is[current]next[Lesson1]]"/> / Previous: <$list filter="[is[current]previous[Lesson1]]"/>

What does the filter produce if the "Lesson1" tiddler is missing or the list field is empty?

Now if you open a tiddler like "SecondBit" you should see at the bottom the controls to move to the next and previous tiddlers.
The next and previous filter operators work by locating the currently selected tiddler(s) in the named list, and returning the adjacent next or previous tiddler from the list.

What if the same tiddler title in the named list more than once...  which occurence does the filter match as the "current selected tiddler"?
What does the [[Navigation]] template display if the current tiddler is not in the list at all?
When you reach the start/end of the list, does it loop around to the end/start, or just stop?
If navigation doesn't loop, when you reach the start/end, can display of non-functional links be suppressed?
Will there also be a [first[Lesson1]] and [last[Lesson1]] so a complete "FPNL" (First/Previous/Next/Last) navigation bar can be displayed?

enjoy,
-e
 

Måns

unread,
Jan 22, 2014, 3:45:24 AM1/22/14
to tiddl...@googlegroups.com, Måns, jeremy...@gmail.com
Hi Jeremy

Great thanks.

I use it like this:
<$list filter="[is[current]tag[Lektion1]]">
<$list filter="[is[current]next[Lektion1]]"/> / Forrige: <$list filter="[is[current]previous[Lektion1]]"/>
</$list>

Will it be possible to define/use a custom viewtemplate at some stage? - like:
$:/tags/LessonViewTemplate

Cheers Måns Mårtensson

Jeremy Ruston

unread,
Jan 22, 2014, 3:50:37 AM1/22/14
to Måns, TiddlyWiki

Will it be possible to define/use a custom viewtemplate at some stage? - like:
$:/tags/LessonViewTemplate

No, that is not planned. TiddlyWiki5 tends to use configuration by tag, rather than configuration by title, as in TiddlyWiki Classic. The purpose of the change is to make it easier to blend and mix customisations. If we have fixed templates then it becomes impossible for another plugin to modify them except by overwriting.

Måns

unread,
Jan 22, 2014, 10:43:33 AM1/22/14
to tiddl...@googlegroups.com, Måns, jeremy...@gmail.com
Hi Jeremy

>TiddlyWiki5 tends to use configuration by tag, rather than configuration by title, as in TiddlyWiki Classic. The purpose of the change is to make it easier to blend and mix customisations. If we have fixed templates then it becomes impossible for another plugin to modify them except by overwriting.

That makes sense :)

Thanks.

Cheers Måns Mårtensson

Måns

unread,
Jan 22, 2014, 11:19:07 AM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy

>Let's say you have a tiddler called "Lesson1" with the "list" field set to: [[First Bit]] SecondBit FinalBit

Is it possible to use the list macro/widget-thingy to generate the "list" field value and sort by a second custom field value? like this:

list: <$list filter="[is[current]tag[Lesson1] sort[nummer]]"/>

My idea is that I want all tiddlers tagged with Lesson1 automatically added to the list...

(I tried the above - however it didn't work for me...)

Cheers Måns Mårtensson

Stephan Hradek

unread,
Jan 22, 2014, 11:23:20 AM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com


Am Mittwoch, 22. Januar 2014 17:19:07 UTC+1 schrieb Måns:

Is it possible to use the list macro/widget-thingy to generate the "list" field value and sort by a second custom field value?

Should be possible. Give me an example Wiki and I'll try to create the proper code for you…

Måns

unread,
Jan 22, 2014, 12:44:30 PM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Stephan

I made two minimal test cases:

1) http://xn--mns-ula.dk/mtc2/ works with a "hardcoded" list of tiddlers as a value in the Navigation tiddler's list field.
2) http://xn--mns-ula.dk/mtc/ doesn't work with a list filter expression as a value in the Navigation tiddler's list field.

Password is "tester"

Cheers Måns Mårtensson

Måns

unread,
Jan 22, 2014, 12:47:08 PM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Btw - The notification popup for saving the wiki throws errors - even if it does save back to the server...

Stephan Hradek

unread,
Jan 22, 2014, 1:08:59 PM1/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
I've created a Lesson2 and a tiddler "ToC" containing:

<$list filter="[tags[]prefix[Lesson]]">
! <$view field="title"/>
{{{ [tag{!!title}sort[number]] }}}
</$list>

Does this help?

Danielo Rodríguez

unread,
Jan 22, 2014, 1:11:45 PM1/22/14
to tiddl...@googlegroups.com
If you want the next button to not be displayed when no next tiddler just don't use a fixed string for next and previous. Use the widget link instead, and link to the variable that points to.

<$list.... >
<$link to={{!!title}} >Next </$link>
</$list>

I think that can work.

Stephan Hradek

unread,
Jan 22, 2014, 2:11:01 PM1/22/14
to tiddl...@googlegroups.com
If you want to create the list with a filter and select  the previous and next from it, you need a modified next/previous filter function

https://github.com/Jermolene/TiddlyWiki5/pull/357


Måns

unread,
Jan 22, 2014, 5:55:31 PM1/22/14
to tiddl...@googlegroups.com
Thanks Stephan

Sorry I don't have a clue how to use the modified next/previous filter function....

I've put the simplest list filter tag expression (I could imagine) into the text value field for the custom field: "list" in the tiddler Lesson1. 
list:  <$list filter="[is[current]tag[Lesson1] sort[number]]"/>

Does the modified next/previous filter function make the use of a field (eg "list") obsolete - and should I write the list filter expression directly into the text of the tiddler instead??

I've put the modified next/previous filter js file into the mtc - if anyone wants to try it out.

Please go ahead and save your changes back to the server - backups are created automatically..
user: tester password: tester

Cheers Måns Mårtensson

Stephan Hradek

unread,
Jan 23, 2014, 2:18:40 AM1/23/14
to tiddl...@googlegroups.com
Done

<$list filter="[is[current]tag[Lesson1]]">
Next: <$list filter="[tag[Lesson1]sort[number]next[]]"/> / Previous: <$list filter="[tag[Lesson1]sort[number]previous[]]"/>
</$list>
<$list filter="[is[current]tag[Lesson2]]">
Next: <$list filter="[tag[Lesson2]sort[number]next[]]"/> / Previous: <$list filter="[tag[Lesson2]sort[number]previous[]]"/>
</$list>Code hier eingeben...

I couldn't find how to generalize it. I thought it would work like this, ut it doesn't

<$list filter="[is[current]tags[]prefix[Lesson]]" variable="lesson">
Next: <$list filter="[tag[<
<lesson>>]sort[number]next[]]"/> / Previous: <$list filter="[tag[<<lesson>>]sort[number]previous[]]"/>
</$list>

Again this "variable" stuff is another inconsistency. Usually <<something>> is used for macro invocation, but in the list widget it is used for variables. So this is now the third possibility for using something called "variable":

  1. $variable$ for parameters of macros
  2. $(variable)$ for variables set with <$set>
  3. <<variable>> for variables set with <$list>

:(


Stephan Hradek

unread,
Jan 23, 2014, 2:21:28 AM1/23/14
to tiddl...@googlegroups.com
SOLVED

\define prevnext(lesson)
Previous: <$list filter="[tag[$lesson$]sort[number]previous[]]"/>
 
/ Next: <$list filter="[tag[$lesson$]sort[number]next[]]"/>
\end
<$list filter="[is[current]tags[]prefix[Lesson]]" variable="lesson"><hr><$macrocall $name="prevnext" lesson=<<lesson>>/></$list>


Måns

unread,
Jan 23, 2014, 3:43:56 AM1/23/14
to tiddl...@googlegroups.com
Hi Stephan

Great job!
Brilliant :)

Thank you very much!

I tried to translate it into Danish in mtc2 - For some reason the previous variable stopped working.
I can't see what I did wrong.... (have been staring at it for at least half an hour...)

Cheers Måns Mårtensson

Stephan Hradek

unread,
Jan 23, 2014, 3:54:31 AM1/23/14
to tiddl...@googlegroups.com
Sure! I added $:/core/modules/filters/previous.js which you missed.

Måns

unread,
Jan 23, 2014, 5:59:36 AM1/23/14
to tiddl...@googlegroups.com
Hi Stephan

Thanks. Now it works.

Cheers Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages