如果从
PageOne
或者从您的
PageTwo
,如果使用强类型对象,则可以执行以下操作:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
// Get this PageOne or PageTwo object
var page = Model.Content;
// Get the column node that is descendant of this page
var column = root.Descendants("columnAlias");
// Get all children of the column node that are published
var childs = column.Children.Where(x => x.IsVisible());
if(childs.Count() > 0)
{
<div class="row tile-row">
@foreach(var node in childs)
{
<div class="col-md-3">
<div class="tile">
<h3>@(node.GetPropertyValue("tileTitle"))</h3>
@(node.GetPropertyValue("tileBodyText"))<br/>
<a class="btn btn-more" href="@(node.GetPropertyValue("tileButtonLink"))">@(node.GetPropertyValue("tileButtonText"))</a>
</div>
</div>
}
</div><!--/.row-->
}
}