Skip to main content

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 global folder sorting

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.

Sort my folder form

The last option make possible for users to specify a custom attribute, not in the list; if you don’t like this just add a CSS rules that hide the choice_custom_field element. Use of this last option need some Javascript to be executed.

What this product isn’t

This product only reveal features 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

  • Plone 4.0

Credits

Developed with the support of S. Anna Hospital, Ferrara; S. Anna Hospital supports the PloneGov initiative.

Authors

This product was developed by RedTurtle Technology team.

RedTurtle Technology Site

Changelog

1.0.0 (2011-04-06)

  • added new dates sorting criteria [keul]

  • added the field for a custom way to sort [keul]

  • do not show the menu entry if you can’t sort the current object [keul]

  • added some javascript for the new custom field. Not enabled js browser will no be able to use the new feature [keul]

  • tested also on Plone 4

0.2.0 (2011-01-07)

  • fixed typo syntax error in english text [markvl]

  • added dutch translation [markvl]

0.1.0 (2010-12-02)

  • initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.sortmyfolder-1.0.0.tar.gz (20.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page