Umbraco Razor For Each Where Contains Order

 if (Model.NodeById(1066).Children.Where("relatedTo == \""@qFilter "\"").Any())
        {  
          int counter Model.NodeById(1066).Children.Skip(10 @thisPage)
.Take(10).Where("relatedTo.Contains(\""@qFilter "\")").Count();
        @Html.Raw("hello");
       
         foreach (var thisItem in Model.NodeById(1066).Children.
Where("relatedTo.Contains(\""@qFilter "\")").OrderBy("newsDate descending")
.Skip(10 @thisPage).Take(10))
                 {
                  
                  string longDate @thisItem.newsDate.ToString("dd/MM/yyyy");
                  string month @thisItem.newsDate.ToString("MMM");
                  string day @thisItem.newsDate.ToString("dd");
                 <ul class="news_list">
                    <li>
                        <class="news_date_cal"><span class="news_date_cal_day">@month</span><span class="news_date_cal_month"@day</span></p>
                  
                        <h3><title="@thisItem.pageHeading" href="@thisItem.Url">
                        @thisItem.pageHeading </a></h3><p>@longDate</p>
                  
                  
                        @if (@thisItem.newsSummary.Length 100)
                        {
                          <p>@thisItem.newsSummary.Substring(0,100...</p>
                        }
                        else
                        {

Comments

Popular posts from this blog

Umbraco Razor Sort Nodes Ascending or Descending

Umbraco Razor get Querystring

Create a .NET Contact Form that Gets the Last Url Visited in C# Can also be Used in Umbraco