You are here: Home / Documentation / How To's / Displaying Collection Body Text

Displaying Collection Body Text

by klotzj27 — published Sep 23, 2009 01:18 PM, last modified Aug 16, 2016 10:49 AM
Collections have multiple views... none of which display the body text of the items. This is particularly useful for news item collections.

In order to display the body text of collection rather than any of the default views you do the following.

1) Go into portal_skins/plone_content and click on folder_summary_view.

2) Click customize. This will create a copy of this page template in portal_skins/custom.

3) Go to portal_skins/custom and rename the page template you copied to something else.

4) Customize the page template to have the following line.

<div tal:replace="structure item_object/getText|nothing">TEXTY TEXT!</div>

Note: Make sure this is placed before this block of code.

<tal:newsitem condition="python: item_type == 'News Item'">
<tal:name tal:condition="item_creator"
tal:define="author python:mtool.getMemberInfo(item_creator)">
<span i18n:translate="label_by_author">

Now you have a page template that will display the body text for collection items if they have it.

5) Go to portal_types and click on Topic(Collection)

6) Put the name of your new view in 'Available View Methods'. Now your new view is available for use on Collection items.

Note: You can also list this view in 'Default View Method' to make it the default view method for Collections.