0
votes

I just noticed, Sitecore does not render all the fields of Media item to HTML. For example, image item renders only AltText and doesn't "Title" field. In the output page < img > tag does not show "Title" Attribute.

Is this a bug? Any workaround how to render Title attribute. Will it cause any issues to SEO factors?

Thanks

1

1 Answers

0
votes

The "Title" field isn't meant to correspond to the "title" attribute. However, you can apply attributes to the rendered image tag anyway, and assuming you have a method for getting the media item it'd look something like this:

@Html.Sitecore().Field("fieldName", item, new { title = item.GetMediaItem("fieldName").Title })