Hi,
I'm trying to understand all the tools that listbuilder gives me, and I'm finding that groupby is very nearly useless. The doc says -groupby just creates a filter named groupby, which is what it does. Except a filter is used to eliminate rows (adding a where clause). -groupby should actually sort, in order for list items to be grouped in a logical manner by the template.
Therefore, my -groupby block is now down to its simplest expression:
-groupby {
label "Regroupement"
values {
{"Étiquette" record_label}
{"Artiste" short_artist}
}
} \
Its serves two purposes:
- Print the groupby options in the <listfilters> tag output.
- Add the groupby property to the list so that <if @list_properties.groupby@ not nil> can be used in the template
I still have to add the correct sorting manually at the beginning of the TCL file:
if [info exists groupby] {
set orderby $groupby
}
So once groupby is set, the orderby is invalidated.
So, what are my questions?
1. If someone can hit me in the face with something I'm doing blatantly wrong, I'd love it. groupby is underdocumented, so I'm flying blind. This blog post (https://openacs.org/blog/one-entry?entry_id=297278) is the only thing I could find, and it contains non-working code.
2. We'd love for sorting to work inside groups. For this, we'd need orderby to accept multiple columns, in order. Is this at all possible?
Thanks,
Alexandre