Hi Stephen,
Here's a little script I just wrote using *InlineJavascriptPlugin*
which possibly gives you what you want...
title: *GroupBy*
<script>
(function($){
var out="",x={},
filter = "$1",
group = "$2",
sf="$3",
sg="$4",
fmtGroup = "$5" == "$"+"5" ? "; [[%0]]\n" : "$5",
fmtItem = "$6" == "$"+"6" ? ": [[%0]]\n" : "$6";
if(filter=="$"+"1" || group=="$"+"2") return;
group = "[tag[" + group + "]]";
sf = sf == "$"+"3" ? "title" : sf;
sg = sg == "$"+"4" ? "title" : sg;
group = store.sortTiddlers(store.filterTiddlers(group),sf);
$.each(
store.sortTiddlers(store.filterTiddlers(filter),sg),
function(n,t) {
if(t.tags) {
$.each(group,function(n,tid) {
tid = tid.title;
if(t.tags.contains(tid)) {
if(!x[tid]) {
x[tid]=[];
}
x[tid].push(t.title);
}
});
}
}
);
$.each(group,function(n,tid) {
tid = tid.title;
items = x[tid];
if(!items) return;
out += fmtGroup.format(tid);
$.each(items,function(n,tid) {
out += fmtItem.format(tid);
});
});
wikify(out,place);
})(jQuery);
</script>
Run it like so...
<<tiddler GroupBy with:
"[tag[MyCourses]"
"CourseFeatures">>
Here is a list of all transclusion parameters $1..$6
that you can use with the of *GroupBy *script...
1. *filter*
- a filter specifying what tiddlers to consier
2. *group*
- the tag specifying the category by which to group
3. *sort-**filter*
- the sort criteria for the filter *$1*
4. *sort-**group* = the sort criteria for the group *$2*
5. *format-group*
- the format for a group item
- default: "; [[%0]]\n" (%0 = title)
6. *format-item*
- the format for a matching item
- default: ": [[%0]]\n" (%0 = title)
Best wishes, Tobias.
--
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.
For more options, visit https://groups.google.com/d/optout.