@inherits UmbracoViewPage @using Umbraco.Web.Templates @using Newtonsoft.Json.Linq @functions { public static MvcHtmlString RenderElementAttributes(dynamic contentItem) { var attrs = new List(); JObject cfg = contentItem.config; if(cfg != null) foreach (JProperty property in cfg.Properties()) attrs.Add(property.Name + "='" + property.Value.ToString() + "'"); JObject style = contentItem.styles; if (style != null) { var cssVals = new List(); foreach (JProperty property in style.Properties()) cssVals.Add(property.Name + ":" + property.Value.ToString() + ";"); if (cssVals.Any()) attrs.Add("style='" + string.Join(" ", cssVals) + "'"); } return new MvcHtmlString(string.Join(" ", attrs)); } } @if (Model != null && !string.IsNullOrEmpty(Model.ToString())) { var onlyOneColumn = Model.sections != null ? ((System.Collections.ICollection)Model.sections).Count : 0;
@foreach (var s in Model.sections){
@foreach (var row in s.rows){
@foreach (var area in row.areas){
@foreach (var control in area.controls){ if (control != null && control.editor != null && control.editor.view != null){ string editor = "grid/editors/" + control.editor.view.ToString(); @Html.Partial(editor, (object)control) } }
}
}
}
}