Reveal some no-so-hidden Plone feature for sorting your folders
Project description
Introduction
The piece of software that make possible sorting items in Plone contains hidden additional features.
Normally, when you call a sort action in Plone, you call an URL like this:
http://myhost/myfolder/folder_position?position=up&id=content_id
… of course, KSS/jQuery stuff in recent Plone versions will hide this feature, but is still available when you disable Javascript.
The Plone UI has no way today for performing action like this:
http://myhost/myfolder/folder_position?position=ordered&id=fieldname
But the feature is inside Plone: in this way you will sort a folder automatically, using a field value for comparison (like “title”, or “created”).
The folder_position script use internally the orderObjects API. This last method has some additional nice feature that unluckily folder_position not expone to users. But we can fix this.
What this product do
This product add to Plone some of the features that follow, patching Plone a little (see also #11317).
Can now sort a folder in reverse order
You can call URL like this:
http://myhost/myfolder/folder_position?position=ordered&id=created&reverse=1
and this will sort the folder using reverse criteria.
Add “delta” criteria to the sorting mechanism
You can call:
http://myhost/myfolder/folder_position?position=up&id=content_id&delta=4
and this will move the content down by 4 slot instead of default 1 (this feature, if you use Plone KSS/jQuery/Javascript sorting, is not so usefull).
Add a nice Plone interface for all those features
Your “Action” menu will be populated with a new entry: “Sort folder”. This will give to the user a Plone form where he can perform common sort operation.
What this product doesn’t
This product only reveal feature that are already in Plone (inside the orderObjects method). It will not add new sorting behaviour.
Dependencies
Test for collective.sortmyfolder has been done on Plone 3.3. Tests on Plone 4 are welcome.
Changelog
0.1.0 (2010-12-02)
initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for collective.sortmyfolder-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a111083aacc5be1f4185ec3ae21adf4aae8e10635394b452afc8b6f3ae28c8c |
|
MD5 | c1fe5eda258669f0da408e79965c4ed4 |
|
BLAKE2b-256 | 2d4884cb9be820dfbb0d49b2544aa382bc1f25bfbb8ea4839a32c0306bfc1827 |
Hashes for collective.sortmyfolder-0.1.0-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87fa6aa48d5ea3b3b298e2abd9bddcd60942e373acff24dfeb2c82bde137a4f4 |
|
MD5 | cd76838b0be3b146c270771f7e47f0d4 |
|
BLAKE2b-256 | cc0ac2d8169bca13c8252499d65c5e012cef8280be107baef1bd2dcbf7d611ba |