Display FigCaption from Media library

154 views Asked by At

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;
1

There are 1 answers

1
dunston On BEST ANSWER

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

var field = media.InnerItem.Fields["Copyright"]