<$set name=selected value=7><$list filter="[range[1,10]]" variable="item" ><$list filter="[range[1,10]allbefore<selected>] +[prefix<item>]"><<currentTiddler>> is before selected item: <<selected>><br></$list></$list></$set>
This is not the full answer but counting the items in a list can give you helpful information. The set widgets select parameter and the rest operator amongst others all provide the components to do this and do it well.
Perhaps store the number of items from count then use the select parameter to iterate each item. The position in the list will then be a number and last time I looked 4 was after 3, and 3 before 4 so the relation ship is obviouse
Tony
after | find which input title follows a specified one | ||
before | find which input title precedes a specified one |
<$set name=number-or-members value={{{ [filter] +count[]] }}}>
after | find which input title follows a specified one | ||
before | find which input title precedes a specified one | ||
bf | same as rest | ||
butfirst | same as rest | ||
butlast | discard the last N input titles | ||
first | select the first N input titles | ||
last | select the last N input titles | ||
limit | select the first or last N input titles | ✓ | ! |
next | find which titles in a list field follow the input ones | ||
nsort | sort the input by number field | ! | |
nsortcs | sort the input titles by number field, treating upper and lower case as different | ! | |
nth | select the N th input title | ||
order | selectively reverse the input list | ✓ | |
previous | find which titles in a list field precede the input ones | ||
rest | discard the first N input titles | ||
reverse | reverse the order of the input titles | ||
sort | sort the input by text field | ✓ | ! |
sortan | sort the input by text field considering them as alphanumerics | ✓ | ! |
sortcs | sort the input by text field, treating upper and lower case as different |