Search code examples
c#umbracoumbraco6

Umbraco: Get "Last Edits" values from content


In my umbraco project, i require values in the "last Edited" tab, inside C# code.

enter image description here

How can i get those values?

Please Help, Thanks.


Solution

  • It's quite simple. Here's one way of doing it:

    // Assure the query is done to the root node, in this case I was on the root controller.

    var recentUpdatedNodes = Model.Content.DescendantsOrSelf().OrderByDescending(x => x.UpdateDate).Take(50);

    foreach (var node in recentUpdatedNodes)
    {
        @node.Name
        @node.Url
        @node.Id
    }