Try our conversational search powered by Generative AI!

Default image view


I need to have a default view that is used for all images when added to a content area, is this possible to have? I know that I can add a view to the DisplayTemplates folder and reference it in the UIhint, but I don't want to restrict the content area to images only, and I would like to have a default behavior for all images. Is this possible?

Sep 01, 2016 15:51


Just add a view named as your image media type to your ~/Views/Shared folder. If your media type is named ImageMedia the view should be called ImageMedia.cshtml and look something like this:

@model ImageMedia

@if (Model != null)
    <img src="@Url.ContentUrl(Model.ContentLink)" alt="">
Edited, Sep 01, 2016 15:57

Cool, thanks!

Sep 01, 2016 23:17
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.