O'Reilly logo

Kentico CMS 5 Website Development by Thom Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—handling attachments in transformations

As we saw earlier, attachments are added directly to documents. While we learned earlier to display these using web parts, another way of displaying attachments is to modify the transformation of the document type. Within a transformation, attachments can be displayed by adding one of the following controls directly into the transformation code.

~/CMSAdminControls/Attachments/DocumentAttachments.ascx
~/CMSAdminControls/Attachments/AttachmentLightboxGallery.ascx

Now, let's use these controls to display a News attachment. News is displayed on the News page using a Repeater control. The detailed view of each news item is displayed using the CMS.News.NewsDetail transformation. We will modify this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required