Skip to main content

A Plone content rules action that creates a chronological archive.

Project description


sc.contentrules.groupbydate is a very basic content rule action used to organize content under a chronological-based hierarchy on a web site upon publication.

Base use case

A news portal with a few dozen new content items per day needs to organize its information in a chronological, yet human-readable, hierarchy.

To do so, this package is installed in a Plone Site and a new content rule is created. This content rule will be triggered by the publication of an News Item and will initialize a ‘’’Move an item to a date-based folder structure’’’.

This action has a target (/news) and a structure (‘ymd’), so as our News Item, with id hello-world, is published on the site, it will be moved to a a new folder structure under /news. Supposing it’s December 19th, 2008, the item will end in /news/2009/12/19/hello-world.


We will explain step by step how to config this case through plone user interface.

  1. You need go to site setup and then “content rules”.

  2. Click on “Add content rule”.

  3. Set the title and select “workflow state changed” in triggered event and save.

  4. You will be redirected to the previous view but you will see the rule that you just added in a table. You will note that the title is a link. Click it.

  5. Ok, in here you will note that you have two settable categories. Conditions and actions. To make this happen, you need to add two condition and one action. One of the condition must be related to the content type and the the other one to the workflow state of the object.

  6. So, “content type” condition is selected by default. Just click the add button and then select “News item” and save.

  7. To add the second condition, following the last step, you need to select “Workflow state” and then the state that correspond to publication. Could be “publish” or “publish_intenally”.

  8. Now is turn of the action. You will see that “Logger” is selected by default. You need to change it to “Move an item to a date-based folder structure”. Click add.

  9. You are now in the add form of the action. You will see four required fields. “Base folder” is the base folder for the date hierarchy. For this you have different ways to set it. You can search a folder in the text input field or select one of the dropdown menu. In the last one you will note and option called “One level up”. This means that the folder structure date hierarchy will be done one level up of the content selected in which the rule will be applied. This will be useful when we have it to multiple types of contents in which each one are added in different folders. Also, we have the option “Same folder of content” which is obvious to understand. In this case select “News”.

  10. We can have in our site a different type besides Folder to keep content. The Container field basically give us the option to select what content type we are going to need to play the container role. In case that other type is selected, the structure will be based on this type instead of folders. We will leave this field selected is “Folder” which is the default.

  11. Also, we can select the default view for each of this folders. You need to know the name of the view that you want. If the view doesn’t exists, the form will be showing an error. We will leave this field as “folder_listing” which is the default.

  12. In hierarchy structure we can choose the order. Use strftime formating. e.g.: ‘%Y/%m/%d’ to have 2011/11/17 or ‘%Y/%m’ to have 2011/11. Leave this field with default value.

  13. Now you just need to apply this rule in the right place of the site. If you don’t know how to do this, follow this link:


To enable this product in a buildout-based installation:

  1. Edit your buildout.cfg and add sc.contentrules.groupbydate to the list of eggs to install:

    eggs =

After updating the configuration you need to run ‘’bin/buildout’’, which will take care of updating your system.

Go to the ‘Site Setup’ page in a Plone site and click on the ‘Add-ons’ link.

Check the box next to sc.contentrules.groupbydate and click the ‘Activate’ button.

Note: You may have to empty your browser cache and save your resource registries in order to see the effects of the product installation.


  • Érico Andrei

  • Cleber J Santos

  • Gustavo Lepri

  • Héctor Velarde

  • Alejandro Pereira

Development sponsored by Simples Consultoria.


1.3b3 (2012-07-10)

  • Removed dependency on plone.directives.form introduced on previous release. [aleGpereira]

1.3b2 (2012-07-03)

  • Default value for container field in schema was creating problems. Updating this value. [aleGpereira]

  • Fix a little bug for container searcher vocabulary class. [aleGpereira]

1.3b1 (2012-06-21)

  • Added Spanish and updated Brazilian Portuguese translations. [hvelarde]

  • Tested Plone 4.2 compatibility. [hvelarde]

  • Fixed package declaration and updated documentation. [hvelarde]

  • Adding option so user can select the content type used as container. [aleGpereira]

  • Adding a field to set a prefer view method for container. [aleGpereira]

  • Adding integrational and functional test for view validator and container object creation. [aleGpereira]

  • Update README documentation. [aleGpereira]

1.2 (2011-12-06)

  • Move testing to [ericof]

  • Fix Dublin Core support [ericof]

  • Fix permissions for pt-br [lepri]

1.1.1 (2011-08-22)

  • Fix permission for Plone 4.x [cleberjsantos]

1.1 (2011-06-23)

  • Added z3c.autoinclude entry point to mark this as a Plone plugin [erico_andrei]

  • Support for Plone 4.1.x [erico_andrei]

1.0 (2010-07-02)

  • Allow relative paths as base_folder [erico_andrei]

  • Allow inputing of strftime formatting for structure field [erico_andrei]

  • Add dependency of placeful workflow as we need it to avoid publishing content in an unpublished structure [erico_andrei]

0.5 (2009-07-28)

  • Very earlier i18n support [erico_andrei]

  • 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 (51.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page