loading table of contents...

8.1.1. Image Link List Editor

The image link list editor (<bp:imageLinkListPropertyField>) is a simple extension to the standard link list editor. You can use it when you have a linklist that is primarily used to link images to a content item. It can show a thumbnail preview image of the linked content item holding the image. The image link list editor is able to deal with images in Articles, Collections, or related content within content items.

The actual thumbnail displayed for each linked content item depends on the type of the linked content item. The following rules apply:

Type Image chosen
CMSelectionRules Content item linked in the defaultContent linklist
CMCollection First content item linked in the items linklist for which a selection rule applies
CMTeasable First content item linked in the pictures linklist for which a selection rule applies
CMPicture or CMImage Image stored in the data property

Table 8.1. Image Thumbnail selection rules


Note that the rules above are applied in order, recursively, and each rule applies for more generic document types as well. For example, consider a situation where you have a CMArticle "A1" that has two content items linked in its related property, one CMCollection "C", and another CMArticle "A2". The collection in turn links to yet another two CMArticles, "A3" and "A4". For the first item linked in the article (a CMCollection), the respective rule applies that chooses the first item linked in the collection's items property, which is A2, a CMArticle. For this article, the rule for CMTeasables applies, since CMArticle inherits from CMTeasable. Therefore, the first item in the article's pictures property is inspected, which is a CMPicture. So ultimately, you will see thumbnails for

  • The picture linked to from A3

  • The picture linked to from A2

If you need to implement custom rules for thumbnail rendering for your own content types, you can do so by using the ImageLinkListRenderer.registerRenderer(type_name, function) method. See the API documentation of this class for details.

<bp:imageLinkListPropertyField propertyName="{PICTURE_PROPERTY_NAME}"
                                                  maxCardinality="{config.maxCardinality}" />
  
Image link list

Figure 8.1. Image link list


The image link list editor of the image property of an article document.