[tw] Re: Is there a way to assign a generated list to a field? Next/Previous navigation between ToC chapters attempt.
(too old to reply)
Vayu Asura
2017-08-04 13:36:47 UTC
Raw Message
Managed to make it work with two modifications:

<$list variable="parent" filter="[all[current]tags[]!limit[1]]">
<$list filter="[title<parent>tagging[]before<currentTiddler>sort[list]]">
prev: <$link><<toc-caption>></$link>
<$list filter="[title<parent>tagging[]after<currentTiddler>sort[list]]">
next: <$link><<toc-caption>></$link>

For some reason limit[1] yields the last tiddler not the first and my toc
is sorted by list field

I don't understand what `variable` list widget parameter is generally doing
(or specifically here either...). Does it just declare a variable and puts
filter result into it? Do you just separate and abstract the common filter
part with it or is it for something else? I have two tags on a tiddler I
call it from. When I transclude it within the list it yields the resulting
tag, but when I remove the !limit[1] part it regenerates both inner lists
for each of two resulting tags. Wierd. Does it work as an iterator of sorts?

Not exactly what I had in mind as this requires the thing to be present on
every entry rather than on the toc tiddler. But I'll try to adapt your
solution to that as well and post here what I manage.
next[] and previous[] operators... require hard-coded list field to work
If there is a more reasonable way to do it esp without hard-coded lists,
I'm very open to suggestions.
before[] and after[] filters work like previous[] and next[] but use the
current filter result instead of a hard-coded list.
<$list variable="parent" filter="[all[current]tags[]limit[1]]">
<$list filter="[title<parent>tagging[]before<currentTiddler>]">
prev: <$link><<toc-caption>></$link>
<$list filter="[title<parent>tagging[]after<currentTiddler>]">
next: <$link><<toc-caption>></$link>
* the outer <$list> assumes that the first tag on the current tiddler is
the "parent" (a common usage for the <<toc>> macro)
* the inner <$list> uses the tagging[] filter to get the siblings from the
parent, followed by the before[] or after[] filter to find the
previous/next sibling of the current tiddler
let me know how it goes...
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas" (tm)
InsideTiddlyWiki: The Missing Manuals
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 ***@googlegroups.com.
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/0953a9d9-8aff-468b-9050-5f9c6988708b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.