111 lines
6.4 KiB
Plaintext
111 lines
6.4 KiB
Plaintext
@inherits UmbracoViewPage<dynamic>
|
|
@using Umbraco.Web.Templates
|
|
|
|
|
|
@if (Model != null && !string.IsNullOrEmpty(Model.ToString()))
|
|
{
|
|
var onlyOneColumn = Model.columns != null ? ((System.Collections.ICollection)Model.columns).Count : 0;
|
|
|
|
<div class="uSky-grid @(onlyOneColumn > 1 ? "container" : "")">
|
|
<div class="row clearfix">
|
|
@foreach (var column in Model.columns)
|
|
{
|
|
<div class="col-md-@column.grid column">
|
|
@foreach (var row in column.rows)
|
|
{
|
|
<div class="gridrow_@row.uniqueId" >
|
|
<div class="container">
|
|
<div class="row clearfix">
|
|
|
|
@foreach (var cell in row.cells)
|
|
{
|
|
<div class="col-md-@cell.model.grid column">
|
|
|
|
@foreach (var control in cell.controls)
|
|
{
|
|
if (control != null && control.editor != null && control.editor.view != null)
|
|
{
|
|
|
|
string editor = control.editor.view.ToString();
|
|
|
|
switch (editor)
|
|
{
|
|
case "rte":
|
|
<text>
|
|
@Html.Raw(TemplateUtilities.ParseInternalLinks(control.value.ToString()))
|
|
</text>
|
|
break;
|
|
case "macro":
|
|
if (control.value != null)
|
|
{
|
|
string macroAlias = control.value.macroAlias.ToString();
|
|
ViewDataDictionary parameters = new ViewDataDictionary();
|
|
foreach (dynamic mpd in control.value.marcoParamsDictionary)
|
|
{
|
|
parameters.Add(mpd.Name, mpd.Value);
|
|
}
|
|
|
|
<text>
|
|
@Umbraco.RenderMacro(macroAlias, parameters)
|
|
</text>
|
|
}
|
|
break;
|
|
case "textstring":
|
|
|
|
if (control.editor.config.markup != null)
|
|
{
|
|
string markup = control.editor.config.markup.ToString();
|
|
|
|
markup = markup.Replace("#value#", control.value.ToString());
|
|
markup = markup.Replace("#style#", control.editor.config.style.ToString());
|
|
|
|
<text>
|
|
@Html.Raw(markup)
|
|
</text>
|
|
}
|
|
else
|
|
{
|
|
<text>
|
|
<div style="@control.editor.config.style">@control.value</div>
|
|
</text>
|
|
}
|
|
|
|
break;
|
|
case "media":
|
|
<text>
|
|
@if (control.value != null)
|
|
{
|
|
<div class="thumbnail">
|
|
<img src="@control.value.image">
|
|
</div>
|
|
if (control.value.caption != null)
|
|
{
|
|
<p class="caption">@control.value.caption</p>
|
|
}
|
|
}
|
|
</text>
|
|
break;
|
|
case "embed":
|
|
<text>
|
|
@Html.Raw(control.value)
|
|
</text>
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
} |