We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    ok, the query looks ok and you say it does work.

    Now, it's the question, why you don't get any output.

    what happens, when you remove

    the &tpl - property

    what is the content of your chunk search.calender.list.item
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 19328
      • 433 Posts
      When I remove the tpl property, I still don't get any output.

      The tpl looks like this;

      <li class="event clickable">
      <h3><a href="[[++site_url]]agenda?detail=[[+id]]" class="forwardLink">[[+startdate:date=`%A %e %B %Y`]] [[+durDay:notempty=`<br />t/m [[+enddate:date=`%A %e %B %Y`]]`]]</a></h3>
      <p><span class="title">[[+title]]</span></p>
      [[+description]]
      startdate = [[+startdate]] 
      </li>
      


      When I use this snippet call without the startdate filter but with the tpl, I do get results:
      [[!migxLoopCollection?
         &packageName=`mxcalendars`
         &classname=`mxCalendarEvents`
         &where=`{"title:LIKE":"%event%"}`
         &sortConfig=`[{"sortby":"startdate"}]`
         &tpl=`search.kalender.lijst.item`
      ]]




        • 19328
        • 433 Posts
        Well I tried everything I could think of but couldn't get this to work with Rowboat or MigxLoopCollection.
        So I wrote a little snippet myself to get the results, it looks like this and it works.

        $c = $modx->newQuery('mxCalendarEvents');
        $c->where(array(
           'title:LIKE'=> '%event%',
            'AND:startdate:>=' => time()
        ));
        $c->sortby('startdate','ASC');
        $events = $modx->getCollection('mxCalendarEvents',$c);
        foreach ($events as $event) {
           $eventArray = $event->toArray();
           $output .= $modx->getChunk('search.calender.list.item',$eventArray);
        }
        return $output;
        


        Would you know why this is working and the other snippets aren't? Beats me!
          • 4172
          • 5,888 Posts
          I can't think, why migxLoopCollection doesn't output any results there.
          It doesn't make much differently than what your snippet does, internally.

          And the strange thing is, that it's working for me on my site.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 19328
            • 433 Posts
            yeah it really strange... I have absolutely no idea what it could be.
            But I'm glad I got it working now another way, and I just hope to never run into this ever again ;-)
            Thanks for all your help!