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
    Quote from: microcipcip at Feb 03, 2012, 09:35 PM
    Hi,

    Is there a way, in the Grid Columns, to show the name and not the value of the "Listbox (Single Select)" TV?

    see this post:
    https://forums.modx.com/thread/41006/migx---multiitemsgridtv-for-modx---revolution?page=12#dis-post-236932
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 19369
      • 1,098 Posts
      Hi Bruno,

      Thanks it works perfectly!
      Just a note, in your snippet there is a missing $.
      <?php
      $val = explode(':',$input);
      return $val[1];
        • 23018
        • 353 Posts
        Something new. I'm trying to filter rows in a MIGX output depending on the values of a checkbox.
        The checkbox can have 0 no n values.

        The checkbox TV is set to output a comma-delimited list.

        For example it returns:

        Row 1: '' (nothing)
        Row 2: 'slider' (1 value)
        Row 3: 'slider,galery' (2 values)

        So far so good.

        I'm using &where=`{"useImageIn:in":"slider"}` and I only get Row 2 as a result.

        I have checked migx.class.php. Line 481 tells me that arrays are supported (among many other things).

        I've fixed a glitch in the code (or at least I think so).
                            case 'in':
                                $operand = is_array($operand) ? $operand:
                                explode(',', $operand);
                                $output = in_array($subject, $operand) ? $then:
                                (isset($else) ? $else : '');
                                break;
        

        I think it sould be $then : rather than $then:. The same is true for $operand:
        (I'm not sure about that because I normally don't use shorthand if.statements).

        Anyway. It still doesen't work as expected.

        Any advise where to look for the culprit?

        Regards,

        pepebe

        [ed. note: pepebe last edited this post 14 years, 7 months ago.]
          Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
          • 4172
          • 5,888 Posts
          I think you will need the opposite: find the operand in the subject-array, not sure if I'm right.

          If so, you can try this ones:

                              case 'find':
                              case 'find_in_set':
                                  $subject = explode(',', $subject);
                                  $output = in_array($operand , $subject) ? $then : (isset($else) ? $else : '');
                                  break;
                              case 'find_pd':
                              case 'find_in_pipesdelimited_set':
                                  $subject = explode('||', $subject);
                                  $output = in_array($operand , $subject) ? $then : (isset($else) ? $else : '');
                                  break;      
          


          check also, if your array is stored with commas or with pipes as delimiter and try the one or the other.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 19369
            • 1,098 Posts
            Do I need a custom snippet to output the code ordered by date?
              • 4172
              • 5,888 Posts
              sorting by fields isn't included in getImageList.
              you need to presort the array by a custom-snippet.
              Than you can send the ordered json-string to the property

              &value=`[[+sortedjson]]`


              Or call getImageList by your sorting-snippet
              //do here your array-sorting
              
              $params = $scriptProperties;
              $params['value'] = $modx->toJson($sortedarray);
              $modx->runSnippet('getImageList',$params);
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 38692
                • 2 Posts
                hi,
                i've some trouble with migx version 2.0.0 on revo 2.2.0-pl2
                In the beginning it works great, but after a time I can't Add Items to the image TV in the Resource.
                I only see the thumbnails and can delete them. But if I try to add an item the migx browser window starts and says loading... all the time. For the image tv I setup a Media Resource and set all the base_path and base_urls. Maybe someone can explain me what the function behind the 'add item' Button need to work?

                Nevertheless migx is a great modul! Thanx
                  • 4172
                  • 5,888 Posts
                  which response do you get after clicking the 'add item' - button? (firebug)
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 38692
                    • 2 Posts
                    In firebug:
                    assets/components/migx/connector.php 500 Internal Server Error

                    Post:
                    HTTP_MODAUTH modx4f2bc21519cd14.00225414_14f3b6a1c25b853.60050920
                    action mgr/fields
                    autoinc 0
                    class_key modDocument
                    isnew 1
                    itemid 0
                    record_json [{"image":""}]
                    resource_id 41
                    tv_id 27
                    tv_name slideshowTV
                    wctx web

                      • 36926
                      • 701 Posts
                      Is it possible to use alternate templates for odd and even row in the getImageList snippet without the user manually setting what template to use.

                      thanks

                      B

                      This discussion is closed to further replies. Keep calm and carry on.