We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8822
    • 203 Posts
    Does anyone know what would be the best way to generate a list of the 5 latest TV entries, across multiple resources. I need to be able to list the content of the last 5 TVs entered on the system, regardless of what resource they apply to - i also need to list the associated resource. To put it into context, i have a business listing defined as a resource and recommendations for that business defined as TVs, i need to be able to list the 5 latest recommendations across the entire system. What would be the best way of doing this? Thanks everyone.
      • 3749
      • 24,544 Posts
      There's really no way to do that without adding some custom code to keep track. TVs do not have an editedon field, so there's no way to tell when they were last edited.

      The only way I can think of to do it would be fairly complex. You'd need a plugin connected to OnBeforeDocFormSave that checks every TV to see if it's been changed, and if so, records the relevant data either in a file, a chunk, or a custom DB table for later use. If multiple TVs are changed for a given resource, there would still be no way to tell which TVs where edited first.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting