Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

Get Media item url from lookup field

Modified: 2008/12/24 14:38 by Vincevanm - Categorized as: Sitecore

A news editor can choose media items (images or PDF) from a multilist field. We need to display the images and links to the PDF documents on that page. We can't use SC:image here because it's not a media field.

So there is a tree list field (or other fields that save data as guids seperated by '|' characters) with a couple of media items selected.

Check attachment for example XSL code.

Xsl example

in CodeBehind you can do the following:

MediaManager.GetMediaUrl(sc_Item). Where sc_Item is the Sitecore or Media Item

 © Evident Interactive BV