-
Notifications
You must be signed in to change notification settings - Fork 5
Extensions
Steve McNiven-Scott edited this page Oct 31, 2017
·
3 revisions
Currently content added to the Sitefinity\Kendo editors renders out only as links or raw images, it just parses urls. This extension provides detection and resolution for Sitefinity Document and Images generated from RadEditor content. This will allow you to define how they render externally in a cshtml file.
Default file locations:
- ~/ResourcePackages/YourTheme/Mvc/Views/Image/Image.Inline.cshtml
- ~/ResourcePackages/YourTheme/Mvc/Views/Document/DocumentLink.Inline.cshtml
You need to manually create these files for this to work
Usage:
<div>
@Html.Raw((string)Model.Item.Fields.Content, RawContentResolveType.Enhanced)
</div>Or you can optionally define custom views instead of the convention
<div>
@Html.Raw((string)Model.Item.Fields.Content, RawContentResolveType.Enhanced, "/Views/Image/Image.Inline.cshtml", "/Views/Document/DocumentLink.Inline.cshtml")
</div>@model Telerik.Sitefinity.Libraries.Model.Document
<div class="doc inline">
@if (!string.IsNullOrEmpty(Model.MediaUrl))
{
<div class="media">
<div class="media-left">
<i class="icon-file icon-txt icon-md">
<span class="icon-txt-@Model.Extension">@Model.Extension</span>
</i>
</div>
<div class="media-body">
<div>
<a class="@String.Concat("sf", Model.Extension)" href="@Model.MediaUrl">@Model.Title</a>
<span class="text-muted">(@Model.Extension)</span>
</div>
</div>
</div>
}
</div>@model Telerik.Sitefinity.Libraries.Model.Image
<div class="image inline">
<img src="@Model.MediaUrl" title="@Model.Title" alt="@Model.AlternativeText" />
</div>