@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "MasterLayout.cshtml";
}
for root and child
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "MasterLayout.cshtml";
var root = Umbraco.TypedContentAtRoot().FirstOrDefault();
var parent = root.Children().FirstOrDefault(x => x.DocumentTypeAlias == "portFolio");
}
and then getting the values form parent
@foreach (var child in @parent.Children())
{
var img = Umbraco.Media(child.GetPropertyValue<int>("ImagePortfolio"));
<div class="portfolio-item wordpress html bootstrap col-xs-12 col-sm-4 col-md-3">
<div class="recent-work-wrap">
<img class="img-responsive" src="@img.Url" alt="">
<div class="overlay">
<div class="recent-work-inner">
<h3><a href="#"> @child.GetPropertyValue("heading")</a></h3>
<p>@child.GetPropertyValue("description")</p>
<a class="preview" href="@img.Url" rel="prettyPhoto"><i class="fa fa-eye"></i> View</a>
</div>
</div>
</div>
</div><!--/.portfolio-item-->
}
No comments:
Post a Comment