Plone Collections
Also available in presentation mode…
What Is a Collection?
It's a container that dynamically sorts and displays content based on a set of criteria regardless of where that content may be stored on your site.
Similar to:
- Search engine returning results
- Query from a database
- Itunes Playlists
Itunes Example: Joe Satriani smart playlist.
Each time I put in a new cd or add new music by Joe a army of trained monkeys goes and puts the songs inside of my playlist.
Trained Monkeys
Search Result
But Joe is also in multiple bands.
I want this music to be included in my Satriani's playlist so I change the search query so that it matches any of the rules.
- Get any song that has Joe Satraini as a artist OR
- Grab any song that Chickenfoot is the artist as well.
Modified Search Rule
Result:
Many attributes
There are many kinds of attributes I can search for:
- Artist
- Album rating
- album artwork
- composer
- description
- album artist
- date added
- date modified
- ......
Attributes
Song limits
I can limit how many songs this playlist can get. I can have it get the last 10 songs that was added to the playlist.
This is how collections works in plone. It is a playlist of news stories, events, latest photos...
Collections are Powerful!
They Reduce Redundancy!
They Reduce Redundancy!
- Oh, and outdated content
- Broken links, too!
Harness the Power!
Here are just a few great options:
- Categories
- Date of publication
- Type of content
Collections reduce the redundant content, outdated content, and unintentionally broken links.
Common Applications for Collections
- News
- Events
- Photos displayed by date range
- Content displayed by category
Collection Demo
Excuse me while I switch Machines...
Other Search Terms that are useful...
Dates
There are a LOT of Dates!
Date results display the results with the oldest date first, otherwise known as ascending order
- Creation Date - the date the document was made. You can't change the creation date of an object.
- Effective Date - the date when an object is published. You can change the effective date.
- Expiration Date - refers to the day that the item will no longer be publicly available.
- Modification Date- the date the object was last edited. You can't customize this date.
- Event Specific Dates - only apply to objects that are Events.
- Start Date - the date that an event starts
- End Date - the date that the event ends
Creation Date and Effective Date are very similar. They both represent a beginning point of an object. Keep in mind when choosing which one you want to use, an object can be created long before it's published. Thus you would get different results in a Collection depending on which date you used.
We recommend using Effective Date rather than Creation Date for date-oriented collections. This way, your collection shows results based on when they became viewable to the public, which is usually more relevant to the audience of your collection. Also, you can manually adjust the Effective Date to control the sort order, which you can't do with Creation Date.
The Expiration Date is also customizable through the Edit tab. By default, objects have no expiration date.
The Modification Date is the date the object was last edited. Note that this date is determined the day the object is created and will automatically change every time the object is edited. There is no way to customize this date.
Event specific dates - Start and End Dates are very effective for creating recent events and upcoming events collections that will let your audience know what your organization is doing and will be doing in the future.
Setting Dates
Setting up Criteria for dates can be confusing. They have a setup that is not like any of the other Criteria. First, you have to choose whether you want a Relative Date or a Date Range.
A Date Range will allow you to specify an exact range of dates, such as 01/02/08 to 02/02/08. The Date Range is useful when you want to create a Collection with a static date that won't change.The Relative Date allows you to construct a conditional statement. For instance, items modified less than 5 days in the past. The Relative Date can be very useful as it will allow you to create Collections that are automatically updating themselves, such as a Recent News collection or an Upcoming Event section.
Date Range
The Date Range is very easy to understand. Both a Start Date and End Date are required (do not confuse these terms with the Event Specific dates!). The Date Range allows us to enter a beginning and an end date and the display everything within that time frame. Notice also that it allows us to specify a specific time of day as well.
Relative Date
Looking first at the Relative Date option, you can see we have three options to fill out.
I want the results to include objects More or Less than Which Day, In the Past or Future.
The first option is Which Day. This allows us to select the number of days our criterion will include. One of the options is called Now. Using this will set the date range to the current day. The other two options do not matter and can be ignored when using Now.
If you are choosing one of the other two options, here is a statement you'll want to learn: I want the results to include objects More or Less than Which Day, In the Past or Future.
Keeping that in mind, the second option is In the Past or Future. This enables us to choose whether we are looking forward or backward into time.
The last option is More or Less. Here we can choose from three options. Less than allows us to include everything from now to a period of time equal to or less than the Which Day setting, either in the past or future. More than will include everything from beyond our specified number of days equal to or more than Which Day. Finally On the Day will only include things that are on the day we specified in the Which Day. Using the example in the image above if we had selected On the Day instead of Less than our Collection would display only objects that were modified (we are using the Modification Date criterion) 5 days ago.
Now, try reading the statement from above, substituting in the field options you chose.
Creator
When using the Creator criterion, we are filtering objects based on who created them. This might be useful if you want to do a featured author section, where you would only want to display content on your site that has been created by a certain author.
As you can see we have several options for our criteria type. They allow us to restrict the creator to the person currently logged in, enter the name of another user as text, or to select users from a list.
If you want to display results from multiple users, you would need to use the List of values option. Otherwise you would normally use the Text option unless the creator you wanted to select was yourself in which case you would use Restrict to current user.
Description
The Description field is essentially a search box type criterion. However, instead of searching the title and body of a page, it will only search for the text in the Description field of a content object. This criterion is only really useful if you fill out the Description field consistently for all your content objects.
Location
Using the Location criterion is much like specifying a location when you search for a document on your hard drive. By specifying a Location criterion, the results that are displayed in your Collection will only come from that location, most commonly, a folder. This can be useful if you only want to display content that is in the About Us section of your site, for example. This is also useful for narrowing Collection results when combined with other criteria.
Specify a Location
To specify a Location, simply click the Add button, which will pop up a new window showing you a directory of your site.
Put a check next to the item you want.
You can open folders to view content contained within them by clicking directly on the title of the folder you want to open. You may also use the Search box to search for the Title of an object.
Search Text
Search Text is a very useful criterion. It is similar to the search box on your site or an Internet search engine. It takes the text you specify and searches the Title, Description, and Body of all objects and returns any that have the word or phrase you specify. This is useful when you want to find objects that have to deal with a certain thing, especially if the word or phrase appears across many content types.

Related To, Part 1
The Related To field is another field, like Category, that must be specified on a content object prior to being used for a Collection. The Related Items field on an object (found in the Edit area, inside the Categories tab) lets you specify which other objects in your site are similar or are relevant to the object you created. By specifying this field, when you create an object you can create a web of related content that will reference each other (think of a "see also" kind of function).
When you have done this, you can use the Related To criterion in a Collection to display anything related to a specific object.
Related To, Part 2
- Remember the Related To Values list does not work based on which objects are related to content, but on which objects have another object related to it.
Setting Sort Order
Set Sort Order allows a field to sort the results of a collection. Checking Reverse causes the results to display in reverse of the default display order.
After saving the collection, the search criteria will be applied and the results displayed when the collection is viewed. You can create any number of collections for such custom views.
Also, understand that you must publish the collection for results to be visible to the anonymous user.
Setting the Sort Order, Option One:
The order that search results are displayed in a collection is determined by Sort Order.
- Text results - Results display in alphabetical order
- Creator
- Short name - in Plone speak, another name for the URL of an object
- Title
Setting the Sort Order, Option Two:
- Object property results - objects are grouped together by the specified properties
- Tags
- Item type
- Related to - limits results to only those objects that have Related To information specified on their properties
- State
Setting the Sort Order, Option Three:
- Date results - displays the results with the oldest date first, otherwise known as ascending order
- Creation Date - the date the document was made. You can't change the creation date of an object.
- Effective Date - the date when an object is published
- Expiration Date - refers to the day that the item will no longer be publicly available
- Modification Date- the date the object was last edited
- Event Specific Dates - only apply to objects that are Events
- Start Date - the date that an event starts
- End Date - the date that the event ends
Ready to See Your Collection?
Just click View!















.