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
I have followed the article - https://our.umbraco.com/documentation/tutorials/creating-basic-site/articles-parent-and-article-items/
This gets me a list of article items for a particular article parent. However if I had a number of article items under various article parents (eg news items, features etc) How would I get the last 5 of any of those items for the homepage?
Instead of obtaining nodes by ID and getting the children, you can obtain all nodes based on what document type it is. I haven't tested it fully, but it wil be something similar to:
var articles = Umbraco.ContentByXPath("//articlesItem")
.Where(x => x.IsVisible())
.OrderByDescending(x => x.CreateDate)
Despite all the article nodes being different parents, as long as they have the same Document Type then this will work
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted