Steve Ward
Steve Ward

Reputation: 1217

Display FigCaption from Media library

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;

Upvotes: 0

Views: 146

Answers (1)

dunston
dunston

Reputation: 2670

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

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

Upvotes: 3

Related Questions