We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    I'm trying to display only search results with a certain value in a TV. This is a checkbox tv for categories. I only want to search in resources with category 'books'. I don't want to set the category with a filter, it should just be a fixed value.

    In the query hook, I have:

    $andConditions = array(
        'tv.category:like' => '%'.'books'.'%'
    );


    But it's not working. How can I make this work? Thanks for any help!

    MODX Revo 2.2.5
    AdvSearch 1.0.0
      • 19328
      • 433 Posts
      I fixed it already, I didn't understand the syntax.
      For anyone with the same question, the way to do this is:

      $andConditions = array(
          'tv.category:LIKE' => '%books%:string'
      );