We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    Hi @Bruno:
    i got it working now. I'm using the TVfilterfunction from MIGX. But i added a few lines to get the LIKE to work
     elseif($sqlOperator == 'LIKE') {
                            $sqlOperator = 'LIKE';
                            $tvValue = $modx->quote('%' . $f[1] . '%');
                        } 

    I still don't fully understand what the code does. espescialy
    $criteria->condition($criteria->query['where'][0][1], $cond, xPDOQuery::SQL_AND, null, $cGroup);

    remains very enigmatic
    tnx alot
    Rdg
      • 4172
      • 5,888 Posts
      LIKE should also work without modifying the function-code:

      if (isset($_POST["categorie"]) && $_POST["categorie"] != '0') {
          $filter[] = 'categorie==%' . $_POST["categorie"] . '%' ;
      }


      didn't it?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 24629
        • 370 Posts
        Hi Bruno,

        No it didn't work because i assumed the function would place the '%' around the LIKE value and it didn't.
        Ofcourse i could have done that in the build up of Tvfilters array as you suggest but i didn't think of it and i think the function should take that into account. that's why i modified the function.