We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    I'm having a heck of a time targeting MIGX entries in any way with getResources parameters. Maybe I am trying to do something that can't be done without MIGXdb but it seems like I'd be able to use &tvFilters, or something to target the output of the MIGX entries.

    I ended up using the idx parameter to change the results of the display in the template, which is cumbersome, but works for the moment. Now I want to turn some entries off and keep them in the grid, but output new ones as needed. Added a checkbox tv for each entry into MIGX (doesn't display checkbox in the grid though), and added &tvFilter=`myTV==1%` to the getImageList call. However as soon as I uncheck one of the entries, the entire output goes down.

    Seems like MIGX doesn't recognize entries into the grid as resources, and thus, not all getResources parameters work.

    Searching for this hasn't proven fruitful. Ideas? Is MIGXdb my only option?



      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 4172
      • 5,888 Posts
      I'm afraid not to understand what you are trying
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        I want to only output certain migx grid entries. So, let's say I've got 6 rows, but only 4 are valid for this week. The other two will be valid again next week. I don't want to lose the other two row/entries, but just hide them for a while.

        Want to use getResources param &tvFilter=`myTV==1%` as shown in getResources docs to output some, but not all the rows. Have myTV set to checkbox.

        When I uncheck one of the row's myTV checkbox, getImageList thinks that means I want nothing at all.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          MIGx stores its values in a single JSON string, and getResources doesn't decode that string or parse it looking for its values. getResources looks at the whole string as a single value.
            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
            I'm not sure what this has to do with getResources.
            But if you are talking about getImageList and how to filter some items you can do this:

            have a checkbox-field with name 'display' and inputOptions: 'yes==1'

            [[!getImageList? 
              &tvname=`yourMigxTV` 
              &tpl=`yourTpl` 
              &where=`{"display:=":"1"}`
            ]]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Having to do with getResources, is that it says in the docs that you can use getResources parameters in getImageList.

              But now I know why, as Susan explained. I will try your suggestion Bruno, and I'm pretty sure I didn't set the input options at all so maybe that will help some. Thank you! I will report back because I'm fairly sure I'm not the only one who will ever want to turn migx rows on and off.
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Unfortunately, that isn't working for me. Same result. If I check any of the checkboxes, the whole thing goes down.

                [[!getImageList? &tvname=`specialsGrid` &docid=`1` &tpl=`specialsLeftTpl` &where=`{"visible:=":"1"}`]]

                (my tv is named visible)
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 4172
                  • 5,888 Posts
                  this is working for me.
                  what do you get, when you set
                  [[*specialsGrid]]
                  (I want to see the whole json-string) on your Resource 1 without using getImageList?
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 10208 ☆ A M B ☆
                    • 1,780 Posts
                    I'll have to wait till later tonight to do this, as the site is running a couple of campaigns right now and activity is up as a result. It should be quieter later on and I can run this for you then.

                    Thank you!
                      Frogabog- MODX Websites in Portland Oregon
                      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                      Having server issues? These guys have MODX Hosting perfected - SkyToaster