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
    columnbuttons can only be defined with a MIGX - configuration.

    To get a working syntax for renderers, you could try to create the columns with the configurator and copy/paste the generated formtabs-json, while opening the config-modal with 'edit raw'
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 52884
      • 25 Posts
      Hi Bruno,

      in the chunk I am calling a snippet:
      [[getmigxurl? &val=`[[+links]]`]]


      the snippet code:

      <?php
      $val = $modx->getOption('val', $scriptProperties, "");
      /* //the following json is the field content if I do not use a renderer.
      $val = '[{"MIGX_id":"1","url":"asdasd","country":"all","afid":"Standard","releasetitle":"","cnames_ro":"","_this.value":"Standard","cnames":"Überall/Fallback","afidrendered_ro":"","afidrendered":"Standard"},{"MIGX_id":"2","url":"asdasd","country":"DE","afid":"Standard","releasetitle":"","cnames_ro":"","_this.value":"Standard","cnames":"Deutschland","afidrendered_ro":"","afidrendered":"Standard"},{"MIGX_id":"3","url":"asdasda","country":"DE-AT-CH","afid":"Standard","releasetitle":"","cnames_ro":"","_this.value":"","cnames":"GSA","afidrendered_ro":"","afidrendered":"Standard"}]';
      */
      
      
      
      $array = json_decode($val, true);
      if(!isset($array)) return;
      
      $size=0;
      $skey = "url";
      $svalue = "Kein Link gefunden.";
      
      $size = count(array_filter($array, function($element){
          return $element['url'] != 'Kein Link gefunden.';
      }));
      
      $size = $size-1;
      
      $outputtxt = '+ weitere '.$size.' Links';
      
      echo $outputtxt;
      


      The following json is the field content in the manager if I do use the renderer:

      + weitere 2 Links+ weitere 2 Links+ weitere 2 Links
        • 4172
        • 5,888 Posts
        Quote from: balihoo at Aug 25, 2017, 03:11 PM
        Hi Bruno,

        in the chunk I am calling a snippet:
        [[getmigxurl? &val=`[[+links]]`]]



        in which chunk?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 52884
          • 25 Posts
          Quote from: Bruno17 at Aug 25, 2017, 03:41 PM
          Quote from: balihoo at Aug 25, 2017, 03:11 PM
          Hi Bruno,

          in the chunk I am calling a snippet:
          [[getmigxurl? &val=`[[+links]]`]]



          in which chunk?

          ahhhh... now I got it. I had to place my snippet call directly in the renderchunktpl field. For some reason I thought I have to use the getimglist snippet there and call my snippet in the tpl chunk. Now everythings works perfectly fine!
            • 4172
            • 5,888 Posts
            yeah, otherwise you get an output for each item
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!