Re: Macro to create and sort a list based on tag

168 views
Skip to first unread message

Tobias Beer

unread,
Aug 5, 2012, 3:00:37 PM8/5/12
to tiddl...@googlegroups.com
Hi Brandon,

I suggest you change your method. What you do here, seems a rather bad way to use tags. At least you should tag your tiddlers with [[da]] and the [[date]] but not both in one tag. But then [[da]] seems meaningless, [[due]] seems a whole lot better or [[done]] or [[meeting]]. But then, you don't really need tags. You could use fields instead and set {due:2012.08.05}. I would be glad to write you a script that fetches those, even help you migrate your tiddlers... if it's that much.

However, dissecting tags the way you use them does not seem to promote a "used as designed" kind of philosophy.

So, what do you think... change of method?

Tobias.

Eric Shulman

unread,
Aug 5, 2012, 6:33:45 PM8/5/12
to TiddlyWiki
> ...Version 2.6.5 TiddlyWiki running, with MatchTagsPlugin
> ...tiddlers have a date tag in the form da20120802
> ...list of all tiddlers with this type of tag (i.e. da*),
> ...sorted in order of the date indicated in that tag.
> ... they’re not sorted in the way I want

Try placing the "daYYYYMMDD" tag as the FIRST tag in each tiddler, and
then using <<matchTags ... sort:tags ...>> to generate your sorted
output. Although tags are entered into tiddlers as space-separated
values, the are actually stored internally in each tiddler as an array
of text strings. Because the da* tags are first in the array, the
resulting list should hopefully be sorted by that tag value.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact

Brandon Walker

unread,
Aug 6, 2012, 1:39:24 AM8/6/12
to tiddl...@googlegroups.com
Wow, thanks a lot to both of you for the quick replies.  

Eric, your suggestion is simple, works great, and requires very little tweaking ability on my part.  Just what I was looking for.

Tobias, you've just blown my mind by suggesting I add new fields.  I didn't even know I could do that!  I'm totally game for changing methods, but I'm not a programmer; I mostly use software just as it comes out of the box.  But I've just read through  http://tiddlywikiguides.org/index.php?title=Getting_started_with_custom_tiddler_fields and I would like to try my hand at making this work on my own first before I take you up on your very generous offer.  The ForEachTiddler plugin seems like it might be key...


Thanks again guys!
Brandon
Reply all
Reply to author
Forward
0 new messages