How to Add a Collection Portlet

This tutorial teaches you how to create a Collection Portlet step by step with the exhaustive description of each stage and the overview of Plone add-ons built on the basis of Collection Portlets

Collection Portlet

Want to make information on your website more accessible to the users? Collection Portlets in Plone will help you achieve easier information display and extended configuration features for the new information in your website!

Collection Portlets provide newly available data in the most convenient way according to criteria set in your target collection configurations. In fact, Portlets could be considered as the so called ‘viewlets’ that display and distribute the content of your website adding up to the dynamic characteristics.
In order to make your Collection Portlet really work, there are certain preliminary steps that you should take:

Step 1. Create your Collection

First, you should create a Collection using the Add new menu on your Plone website. Collections in Plone are used as containers to store certain data that appear according to the set search criteria. For instance, we would like to have all the information from a website connected with world politics. In order to do this, we create the Collection under the title ‘World Politics’.

You can also limit search results to the number indicated under Number of items tag. This will prevent you from scrolling a long way down before you finally reach the results you actually need.
MIND that you have to set the Tags under Categorization menu in order to help your Target Collection look for all the relevant updated information available on your website. This will display the search results under the given tag created for ad-hoc or in other words, targeted, content organization. In our case, this tag could be 'Politics'.

Step 2. Create your Collection Portlet

Now when you have successfully created Collection with the information you are interested in (NB! You may either leave it Unpublished in State menu in the upper left corner or Publish it if you are sure about the data), the following step to facilitate information display on your website is to create Collection Portlet.
It is necessary first to decide where you want your portlet to appear, on the left or on the right. Suppose you have decided on the location of your Collection Portlet, click Manage portlets menu and choose Collection portlet out of all portlet types available on the Add portlet drop down box.

Now you should set portlet configurations with all details specified by clicking on the portlet header (e.g., 'Politics'). The main thing in configurations is to set the Target Collection, the information from which will be used to display in the given portlet. Our Target Collection is 'World Politics'. Most probably, its title will appear under the Search Results box, otherwise you will have to insert the title yourself and click Search.

There are also several other options of the portlet that you can set in configurations. For example, the Limit field determines how much of the field results you would like to display (e.g., 4) Left blank, the portlet will display all of the search results which could hinder the accessibility and ease of use on the part of your website users.
You can also determine the Sort Order in which the results will appear. The display of randomly selected items from the search results is also possible if you put a tick near the tag. By selecting Show More, there will be more information included with a link to the Target Collection you have chosen. Show Dates option provides you with the information of the Effective Date of the data below its title.

Step 3. Save your Portlet

After you have created your Collection Portlet and set all the configurations, the last but not least thing in importance is to click Save button.
Congratualtions! You have successfully created your first Collection Portlet in Plone! Enjoy your website with Plone functions!


There are also some add-on Plone products that you can install for adding some more functions to your Porlets. For example, QCollection Portlet enables adding css styles to your collection portlet, selecting the attributes you want to display for your collection item (e.g., Tite, Description, etc.) and it also provides the Batching-function that allows splitting the items into pages (with the ability to set the number of pages you want to display).
There is also one of the inventions among Plone add-ons applicable to multilingual websites - collective.portlet.lingualinks. This add-on was inspired by the well-known wikipedia multilingual content management tool. It displays links to available translations of the given page.


Connect with our experts Let's talk