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>

        @* 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))
               <a href="@childPage.Url">@childPage.newsArticleTitle</a>  -  @childPage.newsArticleDate.ToString("dd MMM yyyy")


Popular posts from this blog

Umbraco 7 - C# Razor - Passing a parameter variable from a Template to a Partial View.

Umbraco 7 Hide a page from Navigation or Sub Navigation with umbracoNaviHide using Razor in a template or partial view

Umbraco Razor Sort Nodes Ascending or Descending