Fixes for broken view..

- Create new UmbracoHelper (Missing parameter)
- string.replace can't handle string and IHtmlString
This commit is contained in:
Bjarke Berg
2019-01-21 07:54:35 +01:00
parent a502be606b
commit 46f7c76c0b

View File

@@ -1,12 +1,13 @@
@model dynamic
@using Umbraco.Web.Composing
@using Umbraco.Web.Templates
@if (Model.editor.config.markup != null)
{
string markup = Model.editor.config.markup.ToString();
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
markup = markup.Replace("#value#", umbracoHelper.ReplaceLineBreaksForHtml(HttpUtility.HtmlEncode(Model.value.ToString())));
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current, Current.Services);
markup = markup.Replace("#value#", umbracoHelper.ReplaceLineBreaksForHtml(HttpUtility.HtmlEncode(Model.value.ToString())).ToString());
if (Model.editor.config.style != null)
{
markup = markup.Replace("#style#", Model.editor.config.style.ToString());