On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hello!

    My MIGx elements are constructed in this way:
    [{"MIGX_id": "1", "dateShow": "2012-10-09 12:30:00", "placeShow": "Theatre", "typeShow" "Programs"}, {"MIGX_id": "2 "," dateShow ":" 2012-10-10 12:30:00 "," placeShow ":" Theatre "," typeShow "" Programs "}]


    I can see only one element if I know the exact date. For example the October 9, 2012:
    [[!getImageList?
    	&tvname=`showMultipleDates`
            &docid=`[[+id]]`
    	&where=`{"dateShow:=":"2012-10-09 12:30:00"}`
    ]] 


    I would like to extend this condition and display all the events of October 2012. How to write the condition &where?
    Is it possible to use something like "regexp" ?

    Thanks [ed. note: manonp last edited this post 8 years, 11 months ago.]
    • with this additions
      https://github.com/Bruno17/MIGX/commit/b07b69bb64ef3f2f6d378fdbaaffe4d334f1dd16

      to core/components/migx/model/migx/migx.class.php

      you can now have custom filter-snippets
      and you can do it now this way:

      [[!getImageList?
          &tvname=`showMultipleDates`
          &docid=`[[+id]]`
          &where=`{"dateShow:snippet:filtermonth":"09/2012"}`
      ]]


      snippet 'filtermonth' :

      $month = $modx->getOption('operand',$scriptProperties,'');
      $date = $modx->getOption('subject',$scriptProperties,'');
      $timestamp = strtotime($date);
      $datemonth = strftime('%m/%Y',$timestamp);
      
      return $datemonth == $month ? '1' : '';
      
      [ed. note: Bruno17 last edited this post 8 years, 11 months ago.]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • Thank you very much Bruno17, it works!

        I think these additions will offer me great possibilities.