Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python Other
Tag: 1.3.5-FHNW1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


collective.contentleadimage Package Readme


This products adds complete support for adding descriptive image to any Archetypes based content in Plone site. Each object has new tab "Edit lead image", which allows to upload new or remove current image. It is similar behaviour as Plone News Item (you can add image to news item and this image is displayed in news item overview listing.

There is folder_leadimage_view page template, which can be used to list all items in the folder together with images attached.

There is configuration control panel, where you can set maximum width and height of the uploaded images. The width and height is applied on each image upload (image is automatically resized). You can specify smaller width and height which is used as image preview in the below content title viewlet (next to content Description). Large image is used in the above content body viewlet (floated left at the top of content body).

Below content title viewlet is preffered, but Manager can easily switch the viewlets on/off in the control panel.

There is FieldIndex and metadata in portal_catalog: hasContentLeadImage (True/False). This may help developers to create own templates optimized for displaying lead image.


If you are using zc.buildout and the plone.recipe.zope2instance recipe to manage your project, you can do this:

Add collective.contentleadimage to the list of eggs to install, e.g.:

eggs =

Tell the plone.recipe.zope2instance recipe to install a ZCML slug:

recipe = plone.recipe.zope2instance
zcml =

Re-run buildout, e.g. with:

$ ./bin/buildout

More detailed installation instructions may be found in docs/INSTALL.txt.

Using collective.contentleadimage with provides dynamic image scales for all Plone images since Plone version 4.1.

Below is an example how to use @@images with with portal_catalog hasContentLeadImage metadata column to show a custom sized lead image scale in a folder listing.

Example page template snipper from a folder listing:

<div class="tileItem visualIEFloatFix"
                  tal:define="item_has_leadimage item/hasContentLeadImage;
                                    item_object item/getObject;
                                    item_hide_from_nav item/exclude_from_nav;

                     <img tal:condition="exists:item_has_leadimage"
                          tal:define="scale item_object/@@images; img python:scale.scale('leadImage', width=280, height=280)"
                          tal:replace="structure python: img.tag() if img else None" />

Here is another example how Event content type view template is modified to directly display lead image next to the event details table. The modification was done using z3c.jbot and overriding the template as

The template head:

<html xmlns="" xml:lang="en"

<metal:content-core fill-slot="content-core">
    <metal:content-core define-macro="content-core"
                        tal:define="kssClassesView context/@@kss_field_decorator_view;
                                    getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;
                                    templateId template/getId;
                                    toLocalizedTime nocall:context/@@plone/toLocalizedTime;">

        <tal:comment replace="nothing">
            <!-- Show content lead image above event details on the event page.

            Match image dimensions to the event details table size.

        <div class="lead">

        <div class="lead-image-wrapper" tal:define="scale context/@@images; img python:scale.scale('leadImage', width=300, height=300)" tal:condition="img">
            <img tal:replace="structure python: img.tag() if img else None" />

        <div class="eventDetails vcard">
            <table class="vertical listing"
                   summary="Event details" i18n:attributes="summary summary_event_details;">

Something went wrong with that request. Please try again.