Defining Summaries
The article links displayed on section pages are called
summaries
. A summary usually consists of a subset
of the fields in a content item, which are displayed along with a link
to the full content item. The fields that are to be used in a summary
are defined using the summary
element. In the
following example:
<content-type name="review"> <ui:label>Review</ui:label> <ui:description>A product review</ui:description> <ui:title-field>title</ui:title-field> <panel name="default"> <ui:label>Main Content</ui:label> <ui:description>The main content fields</ui:description> <ref-field-group name="title"/> <ref-field-group name="summary"/> <ref-field-group name="body"/> <ref-field-group name="review"/> </panel> <ref-relation-type-group name="attachments"/> <summary> <ui:label>Content Summary</ui:label> <field name="title" type="basic" mime-type="text/plain"/> <field name="summary" type="basic" mime-type="text/plain"/> </summary> </content-type>
the summary contains title
and
summary
fields.
Note that the summary
element has no effect on how
summaries are created in your JSP templates: the summary template
example listed in Summary Templates would
work with the above content type even if it did not contain a
summary
element. The summary
element is used by
Content Studio
to determine the content of the summaries displayed in section page
editors.
The summary
element is also used by the
Content Engine,
which supports local overwriting of summary
fields. What this means is that when a section editor adds a content
item to a section page, she can also make local changes to the content
of the summary
fields: a content item title that
reads "England Loses Again" can be overwritten with "Humiliated!" on
the section page without affecting the main title. If the same content
item appears in a second section, it can have yet another local title
there.
This functionality is "built-in" to the Content Engine: you do not need to do anything in your templates to enable it.
Note that:
-
You cannot use
ref-field-group
insidesummary
elements: you must directly specify the fields to be included in the summary. -
You cannot use rich text fields (that is,
basic
fields with the MIME typeapplication/xhtml+xml
) in summaries.