We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18219
    • 826 Posts
    Hi,

    I want used several TV in the filter of Ditto.
    Example :
    With the code, I obtain the list of the product = ’Chaise’
    [!Ditto? &tpl=`ListProducts` &startID=`30` &language=`french`  &filter=`tvtype_pdt, Chaise, 1` &hiddenTVs=`type_pdt, lieux_pdt` !]
    


    With the code, I obtain the list of the product pour les lieux = ’Restaurant’
    [!Ditto? &tpl=`ListProducts` &startID=`30` &language=`french`  &filter=`tvlieux_pdt, Restaurant, 1` &hiddenTVs=`type_pdt, lieux_pdt` !]
    


    But I want to obtain the list of the products which are “Chaise” for the “Restaurant”. The following code posts me nothing any more.
    [!Ditto? &tpl=`ListProducts` &startID=`30` &language=`french`  &filter=`tvtype_pdt, [*type_pdt*], 1 | tvlieux_pdt, [*lieux_pdt*], 1` &hiddenTVs=`type_pdt, lieux_pdt` !]
    

    Do you have an idea to post this list?

    Thanks
      Marc
      I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How about filtering for "chaise", and filtering for "restaurant", and using && in your code to get the items that are "chaise" and "restaurant"?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 11975
        • 2,542 Posts
        Hi,

        You should have a look to "tagmode" param in ditto documentation
        I guess using it you could limit the list to items specifying => &tags=`chaise, restaurant` &tagsMode=onlyAllTags

        :-)
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 18397
          • 3,250 Posts
           &filter=`tvtype_pdt,Chaise|tvlieux_pdt,Restaurant`

          Try this which uses actual values for the filter. Note that tags will not work for this nor &&.
            • 18219
            • 826 Posts
            Quote from: sottwell at Aug 28, 2006, 11:26 AM

            How about filtering for "chaise", and filtering for "restaurant", and using && in your code to get the items that are "chaise" and "restaurant"?
            I seek to build a catalogue of product. I have several cards produced (Chair, Table,…) and several places possible of use (Restaurant, School,…). I seek to obtain the products who answer two criteria: To be a chair and to be able to use it in a restaurant. I created two TV:
            tvtype_pdt = `Chaise||Table||...` (Chair, Table,…)
            tvlieux_pdt= `Restaurant||Ecole||...` (Restaurant, School,…)

            To obtain the list of the chairs: &filter=`tvtype_pdt, Chaise, 1` give the result.
            To obtain the list of the products in Restaurant: &filter=`tvlieux_pdt, Restaurant, 1` give the result.
            But to obtain the list of the chairs for a restaurant: &filter=`tvtype_pdt, [*type_pdt*], 1 | tvlieux_pdt, [*lieux_pdt*], 1` or &filter=`tvtype_pdt, Chaise, 1 | tvlieux_pdt, Restaurant, 1` or &filter=`tvtype_pdt, Chaise | tvlieux_pdt, Restaurant` do not give anything.

            Quote from: Mark at Aug 28, 2006, 12:53 PM

             &filter=`tvtype_pdt,Chaise|tvlieux_pdt,Restaurant`

            Try this which uses actual values for the filter. Note that tags will not work for this nor &&.
            use Chaise to use chair instead of [*type_pdt*] is preferable, I am appropriate about it. But I tested several filters always without result.

            Quote from: heliotrope at Aug 28, 2006, 12:03 PM

            Hi,

            You should have a look to "tagmode" param in ditto documentation
            I guess using it you could limit the list to items specifying => &tags=`chaise, restaurant` &tagsMode=onlyAllTags

            :-)
            This idea is interesting but I do not manage to implement it. I tested:
            &tags=`Chaise, Restaurant` &tagsMode=onlyAllTags
            &tags=`Chaise, Restaurant` &tagsMode=`onlyAllTags`
            &tags=`Chaise, Restaurant` &tagsMode=`onlyAllTags` &filter=`tvtype_pdt, Chaise | tvlieux_pdt, Restaurant`
            no result.

            I do not have any more an idea. In which direction do have I to go? Thank you for your assistance.
              Marc
              I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
              • 18397
              • 3,250 Posts

              Note that tags will not work for this nor &&.

              So, you are saying the filter I gave you did not work as a whole but the first portion of it and the second portion work fine alone? Yes?
                • 6726
                • 7,075 Posts
                Quote from: Mark at Aug 28, 2006, 12:53 PM
                 &filter=`tvtype_pdt,Chaise|tvlieux_pdt,Restaurant`

                Try this which uses actual values for the filter. Note that tags will not work for this nor &&.

                Not sure but I think I remember having tried this kind of Ditto code with success... I’ll dig this and confirm though.
                Tags are a workaround, sure, but I am not sure you *have* to use them for this kind of thing.

                Another alternative is try DittoMachine, which allows you to pass parameter to the urls : it was built for the kind of things you want to do, Marc, check it out.
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 18219
                  • 826 Posts
                  Quote from: Mark at Aug 29, 2006, 04:17 PM


                  Note that tags will not work for this nor &&.

                  So, you are saying the filter I gave you did not work as a whole but the first portion of it and the second portion work fine alone? Yes?
                  When I used: &filter=`tvtype_pdt, Chaise, 1` I obtain a list of chairs.
                  When I used: &filter=`tvlieux_pdt, Restaurant, 1` I obtain a list of product for the restaurants.
                  But when I used: &filter=`tvtype_pdt, [*type_pdt*], 1 | tvlieux_pdt, [*lieux_pdt*], 1` or &filter=`tvtype_pdt, Chaise, 1 | tvlieux_pdt, Restaurant, 1` or &filter=`tvtype_pdt, Chaise | tvlieux_pdt, Restaurant` I obtain nothing. :’(
                  If you want, I can create a profil for you in the manager of site for test.
                  Quote from: davidm at Aug 29, 2006, 05:52 PM

                  ...
                  DittoMachine, which allows you to pass parameter to the urls : it was built for the kind of things you want to do, Marc, check it out.
                  Thanks David, I test this snippet in the day.
                    Marc
                    I'm French... Sorry for my bad English, I use ' Google Translator' or other... but that remains that tools wink
                    • 6726
                    • 7,075 Posts
                    Quote from: Marc at Aug 30, 2006, 03:03 AM
                    But when I used: &filter=`tvtype_pdt, [*type_pdt*], 1 | tvlieux_pdt, [*lieux_pdt*], 1` or &filter=`tvtype_pdt, Chaise, 1 | tvlieux_pdt, Restaurant, 1` or &filter=`tvtype_pdt, Chaise | tvlieux_pdt, Restaurant` I obtain nothing. :’(

                    Did you try activating the debug mode to have a better grasp of why you get nothing ?
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                      • 16429
                      • 254 Posts
                      I use many multiple filters, for example:
                      &filter=tvregione,toscana|tvcatvinoit,vinoit
                      

                      And it works.
                      Remember that Ditto filters widgeted TVs, for example if the TV has value of "hello" and the widget is set to "uppercase" the filter needs to be "tvWithTvPrefix,HELLO".
                      Learnt on my skin smiley
                        kudo
                        www.kudolink.com - webdesign (surprised?)

                        [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]