We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19329
    • 12 Posts
    Can someone tell me how I can call the name of the user who last edited the page?

    I want to put in the footer: page last updated on ... by ...

    I got the date happening already.

    Thanks!

    Michelle
      • 16278
      • 928 Posts
      Are all the editors manager users? If so, you can make a snippet like this (I called mine WhoDunnit). There’s also an API function called getWebUserInfo() if all the editors are web users, though I haven’t checked whether the ID returned as "editedby" works for them as well.

      <?php
      $lastEditorId = $modx->documentObject['editedby'];
      $lastEditorInfo = $modx->getUserInfo($lastEditorId);
      
      return $lastEditorInfo['fullname'];
      ?>
      


      KP
        • 36624
        • 535 Posts
        i had little trouble using your code in a ditto chunk so i find this little gem with phx :

        [+editedby:userinfo=`username`+]
          CTRL+SHIFT+U - Clear Cache
          CTRL+SHIFT+H - Hiding Heft Panel
          CTRL+SHIFT+N - Fast Create Resource
          CTRL+ALT+P - Preview Recource (in edit resorce window)
          CTRL+ALT+S - Save