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