We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • hmm interesting - its no good for the community if it becomes segregated into Russian MODX and English MODX. I'd happily volunteer to collaborate with the Russian guys to get this stuff translated too because their snippets look powerful.

    Susan/all, do you know if its possible with pdoResources using the &where paramiter to check other tables, or can it only check TVs and the resource's fields?
      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
      • 4172
      • 5,888 Posts
      with pdoResources you can do joins to other tables, too, and you can use other xpdo-classes than modResource as the main-class at all, if you want.

      Its also possible to modify each row with a snippet before parsing the row and its possible to have a custom pdoFetch - class, if you need addional functionality for all the pdoTools - snippets
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • Bruno, how do I do the table join? Can you show me an example?

        Do you know if pdoResources has any special caching features?

        I found what seems to be his official documentation for all his snippets: http://docs.simpledream.ru/ looks like its quite complete but still all in Russian
          MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
          • 4172
          • 5,888 Posts
          I didn't try this, yet, but reading the code, something like that could work:

          &loadModels = `yourPackageName`
          &leftJoin = `[{"class":"yourClass","alias":"theAlias","on":"modResource.id = theAlias.resource_id"}]`
          &select = `["theAlias.name AS theAlias_name","theAlias.description AS theAlias_description"]`


          you need to try this by yourself and see what happens.

          with migxLoopCollection the same would look like that:

          &packageName=`yourPackageName`
          &classname=`modResource`
          &joins=`[{"class":"yourClass","alias":"theAlias","on":"modResource.id = theAlias.resource_id","selectFields":"name,description"}]`
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36573
            • 173 Posts
            Maybe someone in this thread could help me out.

            I'm using PDOuser to call a list of the users. I need to filter them by a user field.

            This works to filter by user name but

            [[!pdoUsers? &tpl=`userListTpl` &where=`{"username:=":"test"}` &limit=`0`]]


            when I try to filter by "comment" is does not work.

            [[!pdoUsers? &tpl=`userListTpl` &where=`{"comment:=":"comment test"}` &limit=`0`]]


            Other fields such as email, full name, and phone do not work either.
              Everything I know I learned on the internet. Saved me thousands in College tuition,
              • 4172
              • 5,888 Posts
              try

              &where=`{"modUserProfile.fullname:=":"testname"}`
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 36573
                • 173 Posts
                Quote from: Bruno17 at Apr 04, 2014, 04:23 AM
                try

                &where=`{"modUserProfile.fullname:=":"testname"}`

                That did it! Thanks!
                  Everything I know I learned on the internet. Saved me thousands in College tuition,