I have taken avisports site as an example. In avisports site, Article definition has attribute: relatedImage which is of type - AVIImage (subtype: ArticleImage) and thus, this assettype: AVIArticle qualifies for this customization. So overall, AVIImages's attribute: imageFile should be visible as thumbnail in docked and undocked search view on searching AVIArticle in Contributor UI.
Steps to follow:
1. Create a custom element: CustomGlobalThumbnailHtml under "CustomElements > avisports > AVIArticle > UI > Layout > Search > View" as jsp
2. Copy the code from GlobalThumnailHtml.jsp from the element present under "UI > Layout > Search > View" and paste in CustomGlobalThumbnailHtml file. This code is responsible for thumbnail view for AVIArticle as mentioned in ThumbnailViewConfig element under CustomElements.
3. Update CustomGlobalThumnailHtml and include following code after you get the type param, to fetch imageFile attribute and set it as url param and save it. This code will basically fetch AVIImage's imageFile attribute and set as url param.
4. Update ThumnailViewConfig element and DockedThumnailViewConfig element present under "CustomElements > avisports > AVIArticle > UI > Layout > Search > View" to point to CustomGlobalThumbnail element.
5. Save and search any AVIArticle in your avisports, now thumbnails should be visible in thumbnail's view from imageFile attribute of asset - AVIImage.
Thus, in any project, thumbnail can be shown from associated asset's blob attribute in thumbnail search views (Docked and Undocked) with this simple customization.
To simply test it, I directly updated GlobalThumbnailHtml element which is not recommended.
AVIArticle Undocked Thumbnail View |
AVIArticle Docked Thumbnail View |
----------------------------------------------------
SUGGESTIONS/COMMENTS ARE INVITED
----------------------------------------------------
No comments:
Post a Comment