We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23703
    • 180 Posts
    Is there a way to sort posts using the date of a file specified in a TV of the post? The post is a short description of the contents of the file. The file changes more often than the needed description so I would like to sort the posts with the files date. Or even better - sort by the latest date of the file or the post. Is this possible?
      • 18397
      • 3,250 Posts
      Is the TV a file or text TV?
        • 23703
        • 180 Posts
        It’s a text TV.
          • 18397
          • 3,250 Posts
          Until Ditto supports function callbacks for sorting, you could write an @EVAL in a separate TV to get the date of that file. Then have Ditto sort by that TV.
            • 23703
            • 180 Posts
            Excellent! I will try that.

            Thank you!
              • 23703
              • 180 Posts
              Is there a way to get around the problem of @EVAL working in the context of the calling page? To get the TV value, I need the documents ID, but using $modx->documentIdentifier returns the ID of the page with the Ditto call. Jason suggests using Dittos placeholders, but I’m not sure how that would be done.
                • 18397
                • 3,250 Posts
                There was a thread several months back where someone figured out how to get the value from one tv, manipulate it with an @EVAL TV, and save it to a third. He would have had to come up with a workaround.