Question

Using Sitecore 6.5, for jpg we want to display a FigCaption in the HTML mark up such as

<figure> <img src="http://placehold.it/350x100" alt="">
    <figcaption>Figcaption content</figcaption>
</figure>

These are stored in the Sitecore template for jpegs in Exif.Copyright field, but how do we retrieve this in code?

I can access the MediaItem using the code below but that doesn't give me access to Exif.Copyright

MediaItem media = ((ImageField)item.Fields[fieldName]).MediaItem;
Was it helpful?

Solution

You can retrieve the inner item on the media item, and get the field values.

var field = media.InnerItem.Fields["Copyright"]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top