We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22897 ☆ A M B ☆
    • 209 Posts
    I can’t see this having been added in the change log, so thought I’d ask. Has AND logic been added for multiple filters, as an option instead of OR logic?

    Let me explain what I’m trying to do, and someone may say it’s possible with OR logic huh

    I have three TVs: Company1, Company2 and Company3. I’m entering people into the system (a person is a MODx document/page), and each person can be in one or more company.

    When page id 22 is loaded (Company X), I want to select using Ditto all the people where
    Company1 is 22 or Company2 is 22 or Company3 is 22.

    However Ditto’s filters work on the basis of which documents to exclude. So I want to remove all documents where:
    Company1 is not 22 AND Company2 is not 22 AND Company3 is not 22

    I can’t see a way to write that without using an AND operator.

    Is this possible one way or another?

    Edit: The reason I didn’t use tagging was because the user has a different job title in each company, so I needed some way to record these... and it made a neater UI to have (drop-down) company 1, (text input) job title 1, (drop-down) company 2, (text input) job title 2 and so on...
      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
      • 11975
      • 2,542 Posts
      Hi,

      try tvExplorer.

      You’ll find it in the in development forum.

      :-)

      EDIT: you’ll have to tweak a little bit the code to change the behavior of the snippet (expects GET values)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 22897 ☆ A M B ☆
        • 209 Posts
        Thanks heliotrope, I’ve had a read through the tvExplorer snippet code but I cannot see from this how it does the filtering of a Ditto result? From the docs tvExplorer seems geared up for individual fields - how do I bend it to do the filtering I need?

        Thanks smiley
          MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
          • 11975
          • 2,542 Posts
          Hi,

          sorry for my lack of vocabulary ;-)

          here is the form
          [

          We are searching wines from bourgogne AND A.O.C AND Rouge

          here is a screenshots of the ditto debug Mode



          In this sample, you can see that tvexplorer produces additional filters to return AND AND documenty list.
          In order to get The and and results when searching on several tvs we are building opposite filters to the query containing the unselected values.
          Filter 9 and 10 are my own filters but they are quite similar to onlyTags and removeTags

          if you want to do some testing these screenshots come from this sample form => http://www.dixsix.fr/explorer/

            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l