Subscribe: RSS
  • Quote from: treigh at Feb 06, 2017, 06:13 PM
    With the where clause, getResources queries modResource standard object fields. I suspect that your datestart and dateend are TVs, not resource fields. What you need is the tvFilters property or a more complex query using a custom snippet.

    With &tvFilters you could do this (untested):
    &tvFilters=`datestart>=[[!today]]%,dateend>=[[!today]]%`


    Also, I'd advise converting your dates to unix timestamps when comparing against another date. That way you're dealing with numbers instead of strings.

    Same result :/
    • How about a different approach? Since it sounds like you are using getResources can you use the publish and unpublish dates?

      I am using this...

      [[!getPage@Events?
           &elementClass=`modSnippet`
           &element=`getResources`
           &includeTVs=`1`
           &tvPrefix =``
           &tpl=`tpl.Events`
           &showHidden=`1`
           &sortbyTV=`startTime`
           &sortdirTV=`ASC`
           &sortbyTVType=`datetime`
      ]]
      
      <div class="text-center">
           <ul class="pagination">[[!+page.nav]]</ul>
      </div>
      
        DropboxUploader -- Upload files to a Dropbox account.
        DIG -- Dynamic Image Generator
        gus -- Google URL Shortener
        makeQR -- Uses google chart api to make QR codes.
        MODxTweeter -- Update your twitter status on publish.
      • Quote from: bwente at Feb 07, 2017, 09:02 PM
        How about a different approach? Since it sounds like you are using getResources can you use the publish and unpublish dates?

        I am using this...

        [[!getPage@Events?
             &elementClass=`modSnippet`
             &element=`getResources`
             &includeTVs=`1`
             &tvPrefix =``
             &tpl=`tpl.Events`
             &showHidden=`1`
             &sortbyTV=`startTime`
             &sortdirTV=`ASC`
             &sortbyTVType=`datetime`
        ]]
        
        <div class="text-center">
             <ul class="pagination">[[!+page.nav]]</ul>
        </div>
        

        I wonder if it's not better if I use Articles instead of MIGX. Articles or another Extra, what is your opinion?
        • So you're using MIGX, not getResources? It would be useful if you posted your full getPage call. All the answers, mine included, have assumed you were using getResources in your getPage call. FYI Articles uses getResources to list resources and I'm not sure you'll be well served with Articles.
            A MODx Fanatic
          • Quote from: treigh at Feb 09, 2017, 12:20 AM
            So you're using MIGX, not getResources? It would be useful if you posted your full getPage call. All the answers, mine included, have assumed you were using getResources in your getPage call. FYI Articles uses getResources to list resources and I'm not sure you'll be well served with Articles.

            OK, sorry. My bad. This is my call:

            [[!getPage?
            					&element=`getImageList`
            					&tpl=`agenda.aside`
            					&docid=`16`
            					&limit=`5`
            					&tvname=`agenda`
            					&sort=`[{"sortby":"datestart","sortdir":"ASC"}]`
            					&where=`{"datestart:>=":"[[!today]]"},{"OR:dateend:>=":"[[!today]]"}`
            				]]


            The TV `agenda` is a list of several events which use MIGX. But, with the time of using, I'm afraid that list will be too long to use. So, what is your advice?

            PS I'm aware that this post is not in the right place now and I apologize.
            • I would use a custom-table and a MIGXdb - TV or create a MIGXdb - CMP
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
              • Quote from: Bruno17 at Feb 09, 2017, 08:17 AM
                I would use a custom-table and a MIGXdb - TV or create a MIGXdb - CMP

                I thought this solution. First time that I use MIGXdb.
                I hope that I will can sort more easier (when we have a start and end date).