Hello,
Version 1.4 of the Cargo extension has been released. The major change in
this version is the addition of "hierarchy" fields, which was done by Feroz
Ahmed. This was the Google Summer of Code project that I was a co-mentor of
(along with Nischay Nahata and Tobi Oetterer), so this email doubles as a
new version announcement and a GSoC recap of sorts.
Within #cargo_declare, you can now use the "hierarchy" parameter to define
that a certain field has allowed values that are in a hierarchy. If you add
this parameter, the "allowed values=" parameter is supposed to take in a
bulleted, hierarchical list, like:
* Fiction
** Comedy
*** Romantic comedy
** Drama
*** Historical drama
* Non-fiction
Tied in with that, Cargo queries now have two new keywords, "WITHIN" and
"HOLDS WITHIN", for use on hierarchy fields. So to get all films that are
any kind of drama, you could have a call like:
{{#cargo_query:table=Films| where=Genre WITHIN 'Drama'}}
"HOLDS WITHIN" is very similar to "WITHIN", and is used for fields
that can
contain a list of values.
There is also custom handling for hierarchy fields within
Special:Drilldown. All in all, this project turned out very well, and I
hope people make interesting use of it.
(Please note that, if you are upgrading from a previous version of Cargo,
you need to call MediaWiki's update.php script to modify Cargo's DB tables,
because there is an additional field now.)
Other changes and additions in this version are:
- A new parameter, "rows per page", was added for the "dynamic table"
format. It lets you set the default number of rows displayed on each "page"
of results; before it always just 10, though users can adjust it.
- All columns in the "table" format are now sortable, using MediaWiki's
standard "sortable" functionality.
- Support was removed for MediaWiki 1.22.
- There was a bug in which querying failed for tables and fields that had a
number in their name; this has been fixed.
- There were other, smaller, fixes and improvements: thanks to Anomie, Tobi
Oetterer, hashar, Seb35 and Feroz for these.
You can read more about Cargo here:
https://www.mediawiki.org/wiki/Extension:Cargo
-Yaron