|Number of votes:||1|
A listing is a function that can be used in many different ways in EPiServer CMS, both in versions 4 and 5. Listings can be part of many page templates, used for instance when managing news on your Web site, when creating a calendar function or when building discussion forums. The concept of listings in EPiServer CMS is to display content of subpages located under a specific parent page.
Listings are built up of subpages located under a specific parent page in the EPiServer CMS page tree. The parent page can be viewed as a "container" and all, or a selected number of its subpages, will build the content of the list.
In order for the listing to work, it is necessary to point out the container page, that is from where the listing will be generated. You may also want to be able to define the number of pages to be displayed in the list. This means that properties for pointing out the parent page and the number of list items must be available in the page template you want to use for the listing. See an example of how this can be done in EPiServer CMS below.
Let's say you want to create a simple news function for your Web site. In a "News" section on your site, you want to add news pages and display a selected number of these with their content in a list.
This news function is based on the page template "Standard page", which in this example has the property for pointing out a list container, as well as the number of list items to be displayed in the list. When creating the container page called "News", the following settings are done:
Note that in this "Standard page" template it is possible to add a second listing, "Additional listing", which will be displayed in the right column of the page.
When the container page is in place, the news pages are created as subpages to the container page. The news pages are also based on "Standard page", and their content is entered as below.
With the above settings, the resulting listing will look like below.
Note that in this very simple example the listing will display the page name for the news item together with the first part of the text entered in the main body, where the text is cut off after a certain length. Also in this example, each news item is set to be hidden in menus, since you often don't want the news item to be displayed in a menu.
To make it easier for news editors, it is common to have a specific "News item" page template, as in the standard templates of EPiServer CMS 5. This template is defined so that it is automatically hidden in the menu. It also has an introduction field, where you can enter a short text that will be displayed in the listing. The main body text will only be displayed when you click the actual news item. You can also change the page type settings so that under the "News" container page, it is only possible to create pages of type "News items". This way you can make life easier for the editors, which after all is what EPiServer CMS is all about!