Hey Mohammad,
I worked on something like this for my anwiki plugin. The following macro
establishes a "linked list" of tiddlers, by setting the "next" field of a
tiddler to the tiddler next in the chain. It uses Evan's formula plugin
(though Im sure someone else can provide a better solution that does not
use the formula plugin.)
\define showSelectedCards(subfilter, finalLink:'')
<!-- Creates a linked list to quiz on -->
<!-- for the n many cards, we return n-1 -->
<$formula-vars counter="count([$subfilter$])-1">
<!-- iter goes from 0 to n-2 -->
<$list filter="[range<counter>butlast[]]" variable="iter">
<!-- arrays need to be accessed from 1 to n -->
<$formula-vars current="nth([$subfilter$], <<iter>> + 1)"
next="nth([$subfilter$],
<<iter>> + 2)">
<$action-setfield $tiddler=<<current>> $field="next" $value=<<
next>>/>
<!--<Current: <<current>>, Next: <<next>> <br/> -->
</$formula-vars>
</$list>
<!-- take last element with no forward link -->
<$list filter="[range<counter>last[]]" variable="iter">
<$formula-vars current="nth([$subfilter$], <<iter>> + 1)">
<$action-setfield $tiddler=<<current>> next=$finalLink$/>
</$formula-vars>
</$list>
</$formula-vars>
\end
You use it like this:
<$button>
Quiz!
<$macrocall $name="showSelectedCards"
subfilter="tag[Test]!sort[created]" finalLink='Home'/>
</$button>
And can change the subfilter, and final link in the chain.
On Thursday, April 26, 2018 at 3:55:00 PM UTC-5, Mohammad wrote:
>
> One important requirements to use TW for presentation or lecturing is to
> have tiddlers in order.
> There are some ways. My question is here
>
> *How one can have a macro or widget to show at the bottom of tiddler a
> back/next link to move to previous or next tiddler.*
>
> The tiddler can be saved in a story.
>
>
> Best
>
>
>
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/038a395c-3ebc-4cd5-8d49-e64d95fad316%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.