You can use a
PHx custom modifier to manipulate output of the placeholder. E.g. create a snippet called
phx:typeImage <?php
//phx:typeImage
//PHx modifier to associate content types with images
//
// usage: [+placeholder:typeImage+]
// placeholder value is in $output
switch ($output) {
case 'application/pdf':
$result = '<img src="/icons/pdf.png" title="pdf" />';
break;
case 'text/plain':
$result = '<img src="/icons/notepad.png" title="text" />';
break;
default:
$result = '???';
}
return $result;
?>
PHx is built in to Ditto, so all you need to do in your chunk is send the placeholder’s output to the modifier like this:
File type: [+contentType:imageType+]
(not tested!)

KP