We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34616
    • 14 Posts
    I’m sure this is a simple fail on my part. But going from ditto to getresources I can’t manage to get content working.

    I started with this:
    [!Ditto? &parents=`65` &tpl=`ditto_events` &orderBy=`newsdate ASC` &dateSource=`newsdate` &filter=`newsdate,@EVAL return strtotime("now");,3`!]

    tried what I figured would be this:
    [[!getResources? &parents=`65` &includeTVs=`1` &tpl=`ditto_events` &sortby=`newsdate` &sortdir=`ASC` &dateSource=`newsdate` &filter=`newsdate,@EVAL return strtotime("now");,3`]]

    I’m sure it might be the &filter or &dateSource but I haven’t figured out what properties to use instead.

    Thanks for any help.
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      I’m not sure if you can use the @EVAL like that... have you tried hard-coding values for those parameters or omitting those parameters entirely? That’d help you isolate what’s causing the problem at least...
        • 33337
        • 3,975 Posts
        Check &tvFilters and/or &where for &filters replacement on http://rtfm.modx.com/display/ADDON/getResources

        &dateSource is not applicable anymore. You will use the placeholder of the date field or TV inside your template to output date. For filtering on date, please refer to the above link.
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 9102 ☆ A M B ☆
          • 318 Posts
          Also, depending on what’s in your template, you may want to set &processTVs=`1` and &tvPrefix=``, and to get the sorting to work you’ll want to use &sortbyTV and &sortdirTV instead of &sortby and &sortdir. Also, set &sortbyTVType=`datetime` and make sure the datetime values stored in your database are in the standard mySQL format starting with the year - for some reason mine were wrong when I upgraded and it took me quite some time to figure out why it wasn’t sorting correctly.
            • 34616
            • 14 Posts
            Thanks for the replies, im sure once I dig deep I might find a solution. Kind of silly a simple ditto line has to be so complex using getresouces.