[TW5] How to user a widget/macro to add new tiddlers in a field list and use it for next/previous navigation

151 views
Skip to first unread message

Jose Novo

unread,
Jun 5, 2017, 8:57:47 AM6/5/17
to TiddlyWiki
Hi,

I'm trying to use a next/previous filters to create a naviagtion path beetween my tiddlers.

It works fine when I hardtype the tiddlers in a list field, but when I try to use a widget list or macro in the list field to add authomaticly new tiddlers when I'll create them it doesn't work.

I've read this suject in https://groups.google.com/forum/?hl=en&pli=1#!topic/tiddlywiki/GlWwfKh0ntI but I'm sure if is possible and how.

Thanks in advance.
Jose

Mark S.

unread,
Jun 5, 2017, 9:35:10 AM6/5/17
to TiddlyWiki
If you're not using it already, I think what you want is the ActionListopsWidget (http://tiddlywiki.com/#ActionListopsWidget).

It might help if you showed what you've done so far.

Good luck!
Mark

Jose Novo

unread,
Jun 5, 2017, 5:21:42 PM6/5/17
to TiddlyWiki
Thank you Marc,

I didn't know the ActionListops Widget, but I see that is necessary a trigger for execute it (how the button widget)

I'll try to explain better what I would like do.

I would like to replicate the behaviour of  Example: Quiz creation that I've seen in http://tw5magick.tiddlyspot.com/

I have many tiddlers about one subject with the same tag (ie: lesson1) and in the Lesson1 tiddler i've created a list field and I've hardtyped all the tiddlers in the order that I want to navigate.
After I've created a navigation tiddler with the following content

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

This works perfect, but I would like don't have to hardtype every new tiddler that I'll create with the tag Lesson1in the list filed, but If I use the list widget or I create a macro and i put it in the field list don't work.

<$list filter="tag[lesson1]" />

or

\define addToLIst () <$list filter="tag[lesson1]" /> and I put in the list field <<addToList>>

Thank you again
Jose

Jose Novo

unread,
Jun 5, 2017, 5:40:39 PM6/5/17
to TiddlyWiki
I forgot to write two things:

First, I've tagged the navigation tiddler with the tag $:/tags/wiew to show the navigation prev/netxt  in every tiddler.

Second, when I change the content of the list field in the Lesson 1 tiddler for the list widget or a macro and I show it in the body of the tiddler with {{!!list}}I can see all the tiddlers with the Lesson1 tag but ithe navigation prev/next is emplty.

I send you a TW file tha I've prepared to show you exactly what I do.

Thanks
testquiz.html

Eric Shulman

unread,
Jun 5, 2017, 5:41:38 PM6/5/17
to TiddlyWiki
On Monday, June 5, 2017 at 2:21:42 PM UTC-7, Jose Novo wrote:
I have many tiddlers about one subject with the same tag (ie: lesson1) and in the Lesson1 tiddler i've created a list field and I've hardtyped all the tiddlers in the order that I want to navigate.

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

This works perfect, but I would like don't have to hardtype every new tiddler that I'll create with the tag Lesson1in the list filed, but If I use the list widget or I create a macro and i put it in the field list don't work.

Instead of using "next" and "previous" filters (which work on a list field), you might do better using "before" and "after" filters (which work on the current filter results)

Thus:

<$list filter="[tag[Lesson1]before<currentTiddler>]"/>
<$list filter="[tag[Lesson1]after<currentTiddler>]"/>

The filter first gets the titles of all tiddlers tagged with "Lesson1", and then returns only the title immediately preceding (or following) the current tiddler title.

The order of the titles returned by the tag[Lesson1] filter can be manually controlled by adding a "list" field to the Lesson1 tiddler (similar to what you were doing for the next/previous filters).  Any titles NOT included in that 'list' field are automatically appended to the end of the filter results, following the manually ordered titles.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals

Jose Novo

unread,
Jun 5, 2017, 6:12:48 PM6/5/17
to TiddlyWiki
Thank you very much Eric.

Now It works .

I only make an add (a sort opperand) to adjust the order of tiddlers in your code:

<$list filter="[tag[Lesson1]sort[title]before<currentTiddler>]"/>
<$list filter="[tag[Lesson1]sort[title]after<currentTiddler>]"/>

Thanks again.
Jose
Reply all
Reply to author
Forward
0 new messages