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
    Resource list TVs work in MigX but in my experience you get the resource number displayed in the manger end rather than the URL or resource name. They render fine with processTVs turned on in the front end, but don't appear to be processed in the backend.

    Only the id is stored into the json, not the text.
    The grid doesn't know anything about, which text was selected in the dropdown.
    There are several workarrounds in the forums how its possible to show the selected text.

    With the newest packages from github, it should be possible to use the renderChunk - column-renderer and use a snippet to get the text from the selecte id.

    But wait before trying that. There will be a new commit today with some fixes.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 20093
      • 81 Posts
      Quote from: absent42 at Mar 25, 2013, 11:40 PM
      Quote from: MokoJumbie at Mar 25, 2013, 11:36 PM
      True, that should work as described. Also, I think the reason that 'inputTV: text' works is probably because it's the default inputTVtype.

      Correct me if I'm wrong, but doesn't 'inputTVtype' not allow for any customisation? For example with a Resource List TV, you wouldn't be able to limit the list to a specific parent container.

      Yes, that's correct. I didn't bother to mention it as it was in the link given by masakia. inputTVtype just gives you a basic instance of a TV type with no possibility of customization.

      I am not sure as I haven't tested it, but I thought that setting a Media Source on a MIGX tv might cause inputTVtype fields which normally respect Media Sources to inherit that setting. Even if that is true, I think inputTVtype fields are of fairly limited use.
        • 4172
        • 5,888 Posts
        there are just some settings possible for inputTVtype:

        mediasources, input Option Values, default value, configs(for MIGX and MIGXdb TVs), caption, description(since 2.4)

        If you need more advanced settings on special TV-input-types you will need to use a inputTV.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 42967
          • 143 Posts
          To get the page title in the migx form you need to have the following format in your in tv listing the resources:

          page title==pagetitle:id


          it's pretty ugly but this is what I am using with a single listbox tv (in input option values)

          @EVAL $output = $modx->runSnippet('getResources',array('parents'=>'0','tpl'=>'@INLINE [[+pagetitle]] [[+parent:isnot=`0`:then=`(`:else=``]][[getResourceField? &id=`[[+parent]]` &field=`pagetitle`]][[+parent:isnot=`0`:then=`)`:else=``]]==[[+pagetitle]]:[[+id]]','outputSeparator'=>'||','sortby'=>'pagetitle','sortdir'=>'ASC','limit'=>'0'));return '- Select a page==||' . $output;


          and then in your migx tv, in the grid columns field add the renderFirst render:

          {
            "header": "Internal link", "sortable": "false", "dataIndex": "page","renderer":"this.renderFirst"
          }
          ,

          for the front end you can use a simple snippet to pick what value to display:

          <?php
          $val = explode(':',$input);
          return $val[0];


          and in your chunk

          [[+page:renderFirst]]
          [ed. note: eighthday last edited this post 11 years, 1 month ago.]
            Eighth day design
            Design agency with offices in Edinburgh and Brighton
            • 35860
            • 8 Posts
            Hey everyone,
            I was having similar issues. That ugly php in Input Option Values can be replaced with a @CHUNK binding.
            Ex.: Input Option Values -
            @CHUNK PageLister

            Chunk PageLister content -
            [[getResources? &limit=`0` &tpl=`@INLINE [[+pagetitle]]==[[+pagetitle]]:[[+id]]` &parents=`3,19` &outputSeparator=`||`]] 

            Works like a charm and much more of a MODX way.
            • Quote from: Bruno17 at Mar 26, 2013, 01:07 AM
              there are just some settings possible for inputTVtype:

              mediasources, input Option Values, default value, configs(for MIGX and MIGXdb TVs), caption, description(since 2.4)

              If you need more advanced settings on special TV-input-types you will need to use a inputTV.
              So how do I specify the media source for in inputTVtype of image? Apparently simply assigning the TV to a media source like any image-type TV doesn't do the trick. Can it be done in the Form Tabs field, or do I need to use a Configuration?
                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 is what I get when doing 'import/export' from a MIGX-configuration:

                {
                          "MIGX_id":2,
                          "field":"image",
                          "caption":"Image",
                          "description":"",
                          "description_is_code":"0",
                          "inputTV":"",
                          "inputTVtype":"image",
                          "configs":"",
                          "sourceFrom":"config",
                          "sources":[
                            {
                              "MIGX_id":1,
                              "context":"web",
                              "sourceid":1
                            },
                            {
                              "MIGX_id":2,
                              "context":"de",
                              "sourceid":1
                            }
                          ],
                          "inputOptionValues":"",
                          "default":""
                        }
                


                the not beautyfied version when doing 'edit raw' is:

                {"field":"title","caption":"Title","MIGX_id":1},{"MIGX_id":"2","field":"image","caption":"Image","description":"","description_is_code":"0","inputTV":"","inputTVtype":"image","configs":"","sourceFrom":"config","sources":"[{\"MIGX_id\":\"1\",\"context\":\"web\",\"sourceid\":\"1\"},{\"MIGX_id\":\"2\",\"context\":\"de\",\"sourceid\":\"1\"}]","inputOptionValues":"","default":""}
                


                So I guess you can use something like that directly for a field in formtabs.

                It should also work with using a inputTV and then configure it with sourceFrom: TV
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 28432
                  • 372 Posts
                  Hi all,

                  Is really simple to add a resource list field with Migx.
                  Just add :

                  "inputTVtype":"resourcelist"

                  Like this

                  {"field":"link","caption":"Link","inputTV":"resourcelist"}

                  It could be nice to get a list of all possibilities inputTv type.

                  Thanks you very much Bruno17 for this Extra.
                  Sorry for my English (I'm a lazy French guy).

                  EDIT : {"field":"link","caption":"Link","inputTVtype":"resourcelist"} [ed. note: Steeve last edited this post 7 years, 6 months ago.]
                    • 50272
                    • 89 Posts
                    Hi Steeve

                    Did you ever find that list of inputTV types?

                    In the MIGX docs it talks about...
                    "Helper" TVs still work but are no longer needed; use inputTVtype: instead of inputTV:


                    but I find this simply doesn't work with text or any other types.
                    The problem I have is I cannot find any definitive article saying what, for example,
                    radio buttons or Listbox (Single-Select) should be...
                    i.e. "inputTVtype":"option" or "inputTVtype":"listbox"

                    So when I use something like
                    {"field":"day", "caption":"Day", "inputTVtype":"listbox"},

                    the grid appears to build ok, but there are no drop down options to select [ed. note: geordiechris last edited this post 6 years, 9 months ago.]
                      • 4172
                      • 5,888 Posts
                      the list of default - inputTVtypes:

                      https://github.com/modxcms/revolution/tree/2.x/core/model/modx/processors/element/tv/renders/mgr/input

                      minus ".class.php"

                      + many of custom TV input types, like colorpicker, imageplus, migx, migxdb ...., if installed


                      the best way to configure your MIGX-TV is the MIGX - configurator - CMP, but you could also add inputOptionValues into the field - definition.
                      See:
                      https://forums.modx.com/thread/91403/single-select-listbox-entries-in-migx#dis-post-500011
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!