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>
<p class="news_date_cal"><span class="news_date_cal_day">@month</span><span class="news_date_cal_month"> @day</span></p>
<h3><a 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
{
{
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>
<p class="news_date_cal"><span class="news_date_cal_day">@month</span><span class="news_date_cal_month"> @day</span></p>
<h3><a 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
Post a Comment