Hi all,

Steve I think that your use case is interesting because it shows a limitation of sorting with TW filters (although imho in this specific case the best solution would be to sort the list of tags automatically every time a tag is added to a tiddler). I think another case with the same limitation is when one wants to sort a list of tiddlers by the number of times they are used as tags (i.e. number of tiddlers tagged with them).

I'll try to describe the issue here: the "sort" operator (and the related nsort, sortcs, nsortcs) only work with fields, but sometimes it might make sense to compute the sort criterion with a "sub-filter" instead. As Jed's solution shows, currently the only way is to create the field containing the sort key: in this case the key is the result of the "sub-filter" |"[<currentTiddler>tags[]sort[]]". |In my other example about sorting tags by the number of times they are used, the "sub-filter" would be "[|<currentTiddler>|tagging[]]".

I wonder if it would be possible to implement new "sort" filter operators which would allow the usage of a sub-filter like this? The way I see it it would be used like this:

- Steve's case: "[....sort-list-filter[|<currentTiddler>tags[]sort[]|]]"

- sort by number of tagged tiddlers: "[....nsort-count-filter[|<currentTiddler>|tagging[]]]"

The idea would be that the argument of "sort-list-filter" would be computed for each tiddler resulting from the previous part of the filter, and the result would act like a temporary key on which the overall sorting is based. In the case of "nsort-count-filter", the sub-filter is interpreted as a <$count ...> filter instead of a <$list ...> one. It is important to notice that the variable <currentTiddler> would have to be interpreted inside the loop, i.e. applies to each resulting tiddler and not the current tiddler in which the whole filter is used.

What do you experts think?

ps: btw, does anyone know if there is a difference in performance between using [all[current]...] and [<currentTiddler>...] ?


Regards,
Erwan



On 06/11/15 12:08, steve wrote:
Tobias, Jed:

Again, thanks for responding.

I believe that the available filter criteria (by tags, types, content, dates, etc) is not the limiting factor. Using these I can whip up a list filter to do whatever I want. The example on http://tiddlysquat2.tiddlyspot.com/ <http://www.google.com/url?q=http%3A%2F%2Ftiddlysquat2.tiddlyspot.com%2F&sa=D&sntz=1&usg=AFQjCNGlcb4HW9FQgjnNGMVSfPfU0JRgTw> selects tiddlers that match tag[reference].

The part that seems to be missing is the means to:
[1] sort tags[] for each tiddler and concatenate the sorted tags into a string (maybe use a temporary field?) and
[2] sort the tiddlers according to their respective tag Strings

The example looks like it is doing #1 correctly, i.e., sorting the tags.
The example is only partially successful with #2, sorting the tiddlers.

Tobias: I'll look into your suggestion regarding the use of a dynamic filter.
Jed: Is there a way that I can view the tiddler from your example?

Thanks
Steve Wharton

On Friday, November 6, 2015 at 4:48:29 AM UTC-5, Jed Carty wrote:

    I made something sort of like what you are talking about here
    <http://ooktech.com/jed/ExampleWikis/TiddlerTools/>. It is slow
    and there are still a bunch of bugs but it does some of it anyway.

    It can be a more involved process than you expect depending on
    what you allow as valid search criteria.

--
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] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6eceb037-a36d-429d-be81-ff5d2b5355c9%40googlegroups.com <https://groups.google.com/d/msgid/tiddlywiki/6eceb037-a36d-429d-be81-ff5d2b5355c9%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/563CC52F.7090801%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to