Hello saguaros,
I hadn't looked at the recommended file openly because I was looking for a solution in PHP. In the JA Megafilter directory there is also no "Dust.JS" but only a "dust-helpers.min.js" and a "dust-helpers.js". If I see things correctly, the latter file is responsible for the output, and if I interpret the code correctly, it calls certain functions and queries certain parameters, which are then output via an array.
/ **
* {@size}
* Write the size of the target to the chunk
* Falsy values and true have size 0
* Numbers are returned as-is
* Arrays and strings have size equal to their length
* Objects have size equal to the number of keys they contain
* Dust bodies are evaluated and the length of the string is returned
* Functions are evaluated and the length of their return value is evaluated
* @param key find the size of this value or reference
* /
"size": function (chunk, context, bodies, params) {
var key = params.key,
value, k;
key = context.resolve (params.key);
if (! key || key === true) {
value = 0;
} else if (dust.isArray (key)) {
value = key.length;
} else if (! isNaN (parseFloat (key)) && isFinite (key)) {
value = key;
} else if (typeof key === "object") {
value = 0;
for (k in key) {
if (key.hasOwnProperty (k)) {
value ++;
}
}
} else {
value = (key + '') .length;
}
return chunk.write (value);
}
};
for (var key in helpers) {
dust.helpers [key] = helpers [key];
}
return dust;
}));
So it should actually also be possible with JavaScript to directly control the individual fields and have them output individually.
Of course, I don't expect you to rewrite the file to my liking, but maybe your developers could at least give me a hint as to what the syntax should look like in order to print a single field. Then I would try the rest to assemble myself. If my wish exceeds your capacities, it is not too tragic, I will also find another solution, but if you could help me something, I would be very grateful because I always use such tasks to help me little to learn.
Anyway:
Good luck and thank you!
Chris