문제

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;
도움이 되었습니까?

해결책

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

var field = media.InnerItem.Fields["Copyright"]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top