Umbraco Razor - List Subpages from Specific Node - byNodeId - Liist Lates News - Get Node By Id
@inherits umbraco.MacroEngines.DynamicNodeContext
@using umbraco.NodeFactory
@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@
@if (Model.NodeById(1850).Children.Any())
{
<div class="sideBarWidget">
<h2><a style="color:#ffffff" href="@Model.NodeById(1850).Url" title="News">Scottish Medical Training<br />Latest News</a></h2>
<ul>
@* For each child page under the root node, where the property umbracoNaviHide is not True *@
@foreach (var childPage in Model.NodeById(1850).Children.OrderBy("newsArticleDate descending").Take(4))
{
<li>
<a href="@childPage.Url">@childPage.newsArticleTitle</a> - @childPage.newsArticleDate.ToString("dd MMM yyyy")
</li>
}
</ul>
</div>
}
@using umbraco.NodeFactory
@* Ensure that the Current Page has children, where the property umbracoNaviHide is not True *@
@if (Model.NodeById(1850).Children.Any())
{
<div class="sideBarWidget">
<h2><a style="color:#ffffff" href="@Model.NodeById(1850).Url" title="News">Scottish Medical Training<br />Latest News</a></h2>
<ul>
@* For each child page under the root node, where the property umbracoNaviHide is not True *@
@foreach (var childPage in Model.NodeById(1850).Children.OrderBy("newsArticleDate descending").Take(4))
{
<li>
<a href="@childPage.Url">@childPage.newsArticleTitle</a> - @childPage.newsArticleDate.ToString("dd MMM yyyy")
</li>
}
</ul>
</div>
}
Comments
Post a Comment