We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    This is an auto-generated support/comment thread for Distinct (Ditto Extender).

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Filters a Ditto result set to include only distinct values (based on one or more specified fieldname(s)).
      Author: ManagerManager plugin - customise your ModX manager interface

      Rckt - web development, Sheffield, UK
      • 25663 MODX Staff
      • 12,272 Posts
      Very cool extender. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        I am not sure I understand what it does from its description, but I’ll sure check this out and learn by doing and report !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 7231
          • 4,205 Posts
          This article has a good explanation of how distinct works in MySQL.

          http://www.webdevelopersnotes.com/tutorials/sql/online_mysql_guide_the_distinct_keyword.php3
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 6726
            • 7,075 Posts
            Thanks for enlightening me smiley
            Off to read it !

            Edit : Well, it does what I suspected it does, and my my it’s going to be VERY handy !!!
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 21056
              • 327 Posts
              Quote from: davidm at Mar 18, 2008, 03:21 PM

              I am not sure I understand what it does from its description, but I’ll sure check this out and learn by doing and report !

              I had thought of calling it Unique (as I think it is a more descriptive name) but opted for Distinct because of the parallel with DISTINCT in MySQL.
                Author: ManagerManager plugin - customise your ModX manager interface

                Rckt - web development, Sheffield, UK
                • 21056
                • 327 Posts
                I’ve updated it to 1.0.1 -- purely a bugfix release (incorrect results caused by a silly mistake! rolleyes )
                  Author: ManagerManager plugin - customise your ModX manager interface

                  Rckt - web development, Sheffield, UK
                  • 26843
                  • 4 Posts
                  I installed the extender and it is not working. I started looking through the Ditto code and noticed that in filter.inc.php, the filter variable is called $filter["custom"] and in the extender it is called $filters["custom"}. I changed it to $filter but that has not helped.

                  I have a tv called gCity and I want to populate a drop-down with distinct cities.

                  So to track down the problem, i just started adding echos to see how far the information was going. It appears that none of the variables are being passed into the MakeDistinct function.

                  I spent 2 hours last night trying to track this down and gave up in frustration. Any suggestions.
                    • 21056
                    • 327 Posts
                    Have you included &extenders=`distinct` in your Ditto call?
                      Author: ManagerManager plugin - customise your ModX manager interface

                      Rckt - web development, Sheffield, UK
                      • 26843
                      • 4 Posts
                      This is the Ditto call I have. I have a chunk that generates the option values for a drop-down.

                      [!Ditto? &parents=`53` &tpl=`gCity_dropdown` &display=`100` &total=`100` &sortBy=`gCity` &sortDir=`ASC` &hideFolders=`1` &depth=`3` &extenders=`distinct` &distinct=`gCity` &debug=`1`!]