We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53069
    • 8 Posts
    Hello everyone.

    My problem is I can't change the placeholder name & keep code working. Here's a tutorial how to make butch images upload with MIGX, I took the code from there: https://docs.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader

    When I change the image placeholder to whatever name, say, 'qwe', it stops working. I change it in string 58 to
    "field":"qwe",
    and at string 154 to
    "dataIndex":"qwe",
    , and it doesn't work after that.

    The reason I do that is MiniShop2 uses the same placeholder name [[+image]] & adding photos with this TV results in that Minishop copies thumbnail photo and puts it in the place of photos I upload with MIGX.

    So another solution can be in changing the MiniShop2's placeholder for images. But I don't know how to do that. I tried to change string 74 in msGallery snippet (
    if (isset($row['type']) && $row['type'] == 'image') {
    ), but it doesn't seem to change anything.

    {
      "formtabs":[
        {
          "MIGX_id":71,
          "caption":"Image",
          "print_before_tabs":"0",
          "fields":[
            {
              "field":"title",
              "caption":"Title",
              "MIGX_id":327,
              "pos":1
            },
            {
              "MIGX_id":329,
              "field":"description",
              "caption":"Description",
              "description":"",
              "description_is_code":"0",
              "inputTV":"",
              "inputTVtype":"",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"",
              "sourceFrom":"config",
              "sources":"",
              "inputOptionValues":"",
              "default":"test",
              "useDefaultIfEmpty":"0",
              "pos":2
            },
            {
              "MIGX_id":330,
              "field":"showBtn",
              "caption":"Show button",
              "description":{
                "field":"showBtn",
                "caption":"Show button",
                "inputTV":"showBtn"
              },
              "description_is_code":"0",
              "inputTV":"",
              "inputTVtype":"checkbox",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"",
              "sourceFrom":"config",
              "sources":"",
              "inputOptionValues":"yes==yes",
              "default":"yes",
              "useDefaultIfEmpty":1,
              "pos":3
            },
            {
              "MIGX_id":425,
              "field":"image", // here I change the field to "qwe"
              "caption":"Image",
              "description":"",
              "description_is_code":"0",
              "inputTV":"",
              "inputTVtype":"image",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"none",
              "sourceFrom":"migx",
              "sources":"",
              "inputOptionValues":"",
              "default":"",
              "useDefaultIfEmpty":"0",
              "pos":4
            }
          ],
          "pos":1
        }
      ],
      "contextmenus":"edit_migx||duplicate_migx||remove_migx_and_image||movetotop_migx||movetotop_bottom",
      "actionbuttons":"loadfromsource||uploadfiles",
      "columnbuttons":"",
      "filters":"",
      "extended":{
        "migx_add":"Add Image",
        "disable_add_item":1,
        "add_items_directly":"",
        "formcaption":"Image",
        "update_win_title":"",
        "win_id":"resourcegallery",
        "maxRecords":"",
        "addNewItemAt":"bottom",
        "multiple_formtabs":"",
        "multiple_formtabs_label":"",
        "multiple_formtabs_field":"",
        "multiple_formtabs_optionstext":"",
        "multiple_formtabs_optionsvalue":"",
        "actionbuttonsperrow":4,
        "winbuttonslist":"",
        "extrahandlers":"this.handleColumnSwitch",
        "filtersperrow":4,
        "packageName":"",
        "classname":"",
        "task":"",
        "getlistsort":"",
        "getlistsortdir":"",
        "sortconfig":"",
        "gridpagesize":"",
        "use_custom_prefix":"0",
        "prefix":"",
        "grid":"",
        "gridload_mode":1,
        "check_resid":1,
        "check_resid_TV":"",
        "join_alias":"",
        "has_jointable":"yes",
        "getlistwhere":"",
        "joins":"",
        "hooksnippets":"",
        "cmpmaincaption":"",
        "cmptabcaption":"",
        "cmptabdescription":"",
        "cmptabcontroller":"",
        "winbuttons":"",
        "onsubmitsuccess":"",
        "submitparams":""
      },
      "columns":[
        {
          "MIGX_id":1,
          "header":"ID",
          "dataIndex":"MIGX_id",
          "width":10,
          "renderer":"",
          "sortable":"false",
          "show_in_grid":1
        },
        {
          "MIGX_id":2,
          "header":"Title",
          "dataIndex":"title",
          "width":20,
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":3,
          "header":"Image",
          "dataIndex":"image", // here I change the dataIndex to "qwe"
          "width":20,
          "renderer":"this.renderImage",
          "sortable":"false",
          "show_in_grid":1
        },
        {
          "MIGX_id":4,
          "header":"Published",
          "dataIndex":"published",
          "width":"",
          "sortable":"false",
          "show_in_grid":1,
          "renderer":"this.renderSwitchStatusOptions",
          "clickaction":"switchOption",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":[
            {
              "MIGX_id":1,
              "name":"published",
              "use_as_fallback":1,
              "value":1,
              "clickaction":"switchOption",
              "handler":"",
              "image":"assets\/components\/migx\/style\/images\/cb_ticked.png"
            },
            {
              "MIGX_id":2,
              "name":"published",
              "use_as_fallback":"",
              "value":1,
              "clickaction":"switchOption",
              "handler":"",
              "image":"assets\/components\/migx\/style\/images\/cb_ticked.png"
            },
            {
              "MIGX_id":3,
              "name":"unpublished",
              "use_as_fallback":"",
              "value":"0",
              "clickaction":"switchOption",
              "handler":"",
              "image":"assets\/components\/migx\/style\/images\/cb_empty.png"
            }
          ],
          "editor":""
        }
      ]
    }
    


    So, what am I doing wrong and is there the way to solve this problem? Thanks VERY much for answers in advance.
      • 4172
      • 5,888 Posts
      try to add a new media-source-setting, like:

      migxFileFieldname: qwe
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 53069
        • 8 Posts
        Quote from: Bruno17 at Apr 25, 2017, 12:31 AM
        try to add a new media-source-setting, like:

        migxFileFieldname: qwe

        Where should I do that?

        Here I don't see where I can set it:



        Thank you!