force add base.cshtml

This commit is contained in:
per ploug
2014-11-18 13:22:56 +01:00
parent 7007389505
commit 163a03986c

View File

@@ -0,0 +1,24 @@
@model dynamic
@using Umbraco.Web.Templates
@functions {
public static string EditorView(dynamic contentItem)
{
string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString();
view = view.ToLower().Replace(".html", ".cshtml");
if (!view.Contains("/")) {
view = "grid/editors/" + view;
}
return view;
}
}
@try
{
string editor = EditorView(Model);
<text>@Html.Partial(editor, (object)Model)</text>
}
catch (Exception ex) {
<pre>@ex.ToString()</pre>
}