We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    &where=`{"ResourceGroupResources.document_group":"3"`


    sorry, I missed a '}'

    should be:

    &where=`{"ResourceGroupResources.document_group":"3"}`

      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Ah. And with my bad eyes, even if I did know where those were supposed to go, I just don't see them - or not, as the case may be.

      Works perfectly. And no fussing with PHP code. MIGx never ceases to amaze me.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Ah. And with my bad eyes, even if I did know where those were supposed to go, I just don't see them - or not, as the case may be.

        Works perfectly. And no fussing with PHP code. MIGx never ceases to amaze me.
          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
          • 4172
          • 5,888 Posts
          for not in group you can try this:

          <ul>
          [[migxLoopCollection?
          &classname = `modResource`
          &joins=`[{"alias":"ResourceGroupResources","on":"ResourceGroupResources.document_group=1 and ResourceGroupResources.document=modResource.id"}]`
          &where=`{"ResourceGroupResources.document_group":null}`
          &tpl=`@CODE:<li>[[+pagetitle]]([[+id]])</li>`
          ]]
          </ul>
          
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            That works to find resources not in any group. But how would you indicate a "not" in that where clause?
              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
              • 4172
              • 5,888 Posts
              this should work for selecting all resources which are not in group 1

              change the group-id in this here:

              on":"ResourceGroupResources.document_group=3
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                {edited} Never mind; this was 2.3.2 and I upgraded to 2.5.2 and all is well.

                Very strange. On localhost during development, the migx snippet works as expected. But used on a remote server, while it does display the list of resources not in a group, it starts out with a printout of the actual query. I can't imagine why it's doing that, it's exactly the same snippet call as posted above.
                [ed. note: sottwell last edited this post 13 years, 2 months ago.]
                  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
                • discuss.answer
                  • 3749
                  • 24,544 Posts
                  I'm going to guess that either it's some leftover debugging code of Bruno's, or more likely, you put that in there to debug something a while ago and forgot about it. wink

                  I've been there in both cases.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting