[TW5] sorting of tagged tiddlers when tag is clicked

124 views
Skip to first unread message

Michele Zaffalon

unread,
Apr 15, 2015, 3:01:34 AM4/15/15
to tiddl...@googlegroups.com
Hello,

I am keeping a diary where (almost) each tiddler has a field journal-date YYYYMMDD using TiddlyWiki5. These tiddlers have one or more tags, say tagA, tagB...

Currently, when I click on the tag tagA, I get a list of tiddlers tagged by tagA sorted in alphabetical order. I read in here http://tiddlywiki.com/#Tagging that I can use ListField in the tiddler tagA to sort the tiddlers, but the ordering is easily done with sort[journal-date] and I would like to avoid to add them by hand.
I tried to add to the tiddler tagA the statement <$list filter="[all[current]tagging[]sort[journal-date]]"> in the text field but this just prints the list. On the other hand, the instructions http://tiddlywiki.com/#Tagging seem to state that only alphabetical order is allowed.

I see that the ordering is defined in the system tiddler :/core/ui/TagTemplate. When I modify the following line <$list filter="[all[current]tagging[]sort[journal-date]]" template="$:/core/ui/ListItemTemplate"/>, I sort all tiddlers according to journal-date as I would like, for all tags.

Which one is the right way of doing it? Creating tiddlers tagA, tagB... and defining a filter in there, or modifying the system tiddler :/core/ui/TagTemplate?

michele

PMario

unread,
Apr 15, 2015, 4:13:14 AM4/15/15
to tiddl...@googlegroups.com
Hi Michele,


On Wednesday, April 15, 2015 at 9:01:34 AM UTC+2, Michele Zaffalon wrote:
Which one is the right way of doing it? Creating tiddlers tagA, tagB... and defining a filter in there, or modifying the system tiddler :/core/ui/TagTemplate?

The content of tagA and tabB has nothing to do with the tag popup in the tiddler view.

So if you want your desired behaviour for all tiddlers, just edit the TagTemplate. The drawback is, that this may result in an unsorted list for "normal" tag popups, that don't have the sorting field. ...

-m

Richard Smith

unread,
Apr 15, 2015, 4:13:41 AM4/15/15
to tiddl...@googlegroups.com
Hi Michele,

The tag-tiddlers are treated the same as other tiddlers, so they can contain their own content, so putting your filter into the text field of a tag-tiddler will render the list correctly there, but it won't have any effect on the filter expression inside the tag-template. As you say, the list field does affect the order of the list but there's no great way to populate it automatically - you can use the taglist plugin to re-order the list by dragging and dropping and this will populate the list for you but it still seems like overkill to be manually managing this at all when you have the info to do it automatically.

The second method seems to be ok, as far as I know. When you edit the .../TagTemplate tiddler you are creating a copy of it that takes precedence over the version in the core - if the tag template gets updated in the future you won't see the change because you'll still be using your own copy but that's not likely to be a big problem.

Regards,
Richard

Michele Zaffalon

unread,
Apr 15, 2015, 5:20:51 AM4/15/15
to tiddlywiki
Thank you, Richard and PMario for the explanation.
I hoped for a standard way of doing this but after searching the mailing list, I could not find much. Will passing a filter to ListField be supported sometimes in the future?
Regards,
michele

--
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 tiddl...@googlegroups.com.
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/a9fc507a-e81d-4ed3-81f9-84ccd37048b3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jeremy Ruston

unread,
Apr 17, 2015, 9:58:39 AM4/17/15
to TiddlyWiki
Hi Michele

I hoped for a standard way of doing this but after searching the mailing list, I could not find much. Will passing a filter to ListField be supported sometimes in the future?

Funnily enough, I did consider allowing the list filter to contain filter expressions instead of just a title list as at present. At the time of the original design, my concern was performance (filters can be quite slow to evaluate) and simplicity. It's certainly something that would be interesting to investigate now. The good thing is that a title list is a degenerate filter, so if we redefined the list field as a filter it wouldn't break existing wikis.

Best wishes

Jeremy.


 
Regards,
michele

On Wed, Apr 15, 2015 at 10:13 AM, Richard Smith <richardwil...@gmail.com> wrote:
Hi Michele,

The tag-tiddlers are treated the same as other tiddlers, so they can contain their own content, so putting your filter into the text field of a tag-tiddler will render the list correctly there, but it won't have any effect on the filter expression inside the tag-template. As you say, the list field does affect the order of the list but there's no great way to populate it automatically - you can use the taglist plugin to re-order the list by dragging and dropping and this will populate the list for you but it still seems like overkill to be manually managing this at all when you have the info to do it automatically.

The second method seems to be ok, as far as I know. When you edit the .../TagTemplate tiddler you are creating a copy of it that takes precedence over the version in the core - if the tag template gets updated in the future you won't see the change because you'll still be using your own copy but that's not likely to be a big problem.

Regards,
Richard

--
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 tiddl...@googlegroups.com.
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/a9fc507a-e81d-4ed3-81f9-84ccd37048b3%40googlegroups.com.

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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Michele Zaffalon

unread,
Apr 18, 2015, 1:34:40 AM4/18/15
to tiddlywiki
Hi Jeremy,

Thank you for your detailed answer.
Is this something a neophyte like me could do? I tried to set a breakpoint at getTiddlerList and I spent a couple of hours to follow from there to no avail.
I would rely on this new feature for my tiddlywiki at work, but no hurry, so far I managed without.

Best regards,
michele

Reply all
Reply to author
Forward
0 new messages