Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Accusoft 58 posts 109 karma points
    Aug 07, 2012 @ 16:58
    Accusoft
    0

    Determining Who Last Updated Content

    I see in the API there is a way to grab the UpdateDate field.  Is there a way to determine WHO made the last update to a particular content node?  In other words, the user ID of the person that last edited a particular node?

  • Steve Wilkinson 132 posts 211 karma points
    Jan 21, 2015 @ 09:28
    Steve Wilkinson
    0

    Did you manage to find out how?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 21, 2015 @ 10:15
  • Graeme W 113 posts 289 karma points
    Jan 21, 2015 @ 16:55
    Graeme W
    2

    The WriterName property holds the value of the person who last updated a node. This is the partial view macro code I wrote for a macro to list the recent updates to the site.

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    
    @{   
    
        // Get root node:
    
        var root = Model.Content.AncestorOrSelf();
    
    
        // Get the most recently updated nodes
        var nodes = root.Descendants().OrderByDescending(x => x.UpdateDate).Take(20);
        }
    
        <table class="table table-striped">
        <tr><th>Updated</th><th>Created</th><th>Page</th></tr>
          @foreach (var node in nodes)
        {
            <tr>
                <td>
    
                @node.UpdateDate.ToString("dd-MM-yy") 
                &nbsp;
                @node.UpdateDate.ToShortTimeString()
                <br />
                @node.WriterName
                </td>
                <td>
                 @node.CreateDate.ToString("dd-MM-yy") 
                &nbsp;
                @node.CreateDate.ToShortTimeString()
               <br /> 
                @node.CreatorName</td>
                <td>
                    <a href="@node.Url">@node.Name</a>     
    
    
                </td>
    
            </tr>
        }
    
        </table>
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies