We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38878
    • 255 Posts
    Running Revo 2.2.6 and MIGX 2.3.2

    I'm just getting into MIGX and am building a simple product listing. I have successfully built a video manager with it and I am beginning to love it. ATM, I am having an issue filtering TV values on the front end where I need to use an "or" filter. My snippet call looks like this:
      [[!getImageList? 
        &tvname=`Product`
        &tpl=`prodListingTPL`
        &where =`{"prod_category:=":["Packages","Kits"]}`
      ]]
    

    According to the JSON documentation this should work but outputs no data. I can do a simple filter for one match like this without a problem and it works fine:
      [[!getImageList? 
        &tvname=`Product`
        &tpl=`prodListingTPL`
        &where =`{"prod_category:=":"Packages"}`
      ]]
    


    Hopefully it's just a syntax issue and MIGX can handle this. I have looked at all the docs I can find but can't find an example similar to this. Anyone have an idea?

    Thanks in Advance.
      • 19604 ☆ A M B ☆
      • 179 Posts
      Quote from: harveyev at Jan 27, 2013, 09:24 PM
      Hopefully it's just a syntax issue and MIGX can handle this. I have looked at all the docs I can find but can't find an example similar to this. Anyone have an idea?
      Using two separate statements, not a combined one, would result in an AND conjunction:
      {"prod_category:=":"Packages","prod_category:=":"Kits"}

      What you need is an OR conjunction. Maybe Bruno17 can help?
        MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
        http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
        • 38878
        • 255 Posts
        Yep. Exactly. Bruno had an "and" example. I need an "or" and according to JSON docs my syntax is correct

        Quote from: mindeffects at Jan 28, 2013, 02:09 AM
        Quote from: harveyev at Jan 27, 2013, 09:24 PM
        Hopefully it's just a syntax issue and MIGX can handle this. I have looked at all the docs I can find but can't find an example similar to this. Anyone have an idea?
        Using two separate statements, not a combined one, would result in an AND conjunction:
        {"prod_category:=":"Packages","prod_category:=":"Kits"}

        What you need is an OR conjunction. Maybe Bruno17 can help?
          • 4172
          • 5,888 Posts
          try

          &where =`{"prod_category:in_array":["Packages","Kits"]}`
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 38878
            • 255 Posts
            Thanks Bruno. I tested your suggestion and what you provided works but only if there is one category for each product ( I need to allow products to be in multiple categories). When I assign a product to two or more categories, that product does not meet the filter for some reason.

            Also, while Im on the subject of categories, I need to associate one Migx TV to another. For example I would like the categories to be MigX TVs themsleves with pictures and descriptions and such, and be able to associate the Product TV to the Category TV via a dropdown select in the manager but cannot figure out how to do it from the docs. Any help here would also be awesome.

            I am loving this mod btw. TY for writing it.

            Quote from: Bruno17 at Jan 28, 2013, 11:25 AM
            try

            &where =`{"prod_category:in_array":["Packages","Kits"]}`