Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey Guys...
Im trying to loop all nodes through, and I want to get all the items with the NodeTypeAlias "NewsItem"However, im not getting any results?
My sitetree look like (In every "news" folder, i have News items:
- Homepage - Solutions - News - Technics -News - Asia - News - Leasing - News
The script looks like:
@foreach(var item in @Model.AncestorOfSelf().Descendants("NewsItem").OrderBy("NewsDate desc").Take(5)) { <article class="news"> <h2><a href="@item.Url">@item.Name</a></h2> <p> @Html.Raw(@item.summary); <a href="@item.Url">Read more</a> </p> </article> }
Hi Nicky,
Try changing
AncestorOfSelf to AncestorOrSelf()
Ahhhh, didn't see I spelled it wrong :) Thx :)
Did you get it working though?
Yeah, works perfectly
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Why dont i get all the news items nodes?
Hey Guys...
Im trying to loop all nodes through, and I want to get all the items with the NodeTypeAlias "NewsItem"
However, im not getting any results?
My sitetree look like (In every "news" folder, i have News items:
- Homepage
- Solutions
- News
- Technics
-News
- Asia
- News
- Leasing
- News
The script looks like:
Hi Nicky,
Try changing
Ahhhh, didn't see I spelled it wrong :) Thx :)
Did you get it working though?
Yeah, works perfectly
is working on a reply...