gwmbox,
(1) Whoops, my mistake. Yes I had been working on a clone.
I have modified my previous message to change the variable $s2reId to $sobi2Id in the example above.
(2) sobi2.vc.tmpl.php works differently to sobi2.details.tmpl.php
The code example I have given above, only works in sobi2.details.tmpl.php
sobi2.vc.tmpl.php is called as a function and the variable/array values available to it are only those that are passed via function declaration in the initial line of sobi2.vc.tmpl.php , namely;
function sobi2VCview($id, $style, $ico, $img, $title, $fieldsObjects, $fieldsFormatted, $plugins, $editButton = null, $deleteButton = null) {
to see what values are passed add the following "debugging" code into your sobi2.vc.tmpl.php after the function declaration;
print 'Line '.__LINE__.' $id structure <pre>'; print_r ($id); print "</pre><br />\n";
print 'Line '.__LINE__.' $style structure <pre>'; print_r ($style); print "</pre><br />\n";
print 'Line '.__LINE__.' $ico structure <pre>'; print_r ($ico); print "</pre><br />\n";
print 'Line '.__LINE__.' $title structure <pre>'; print_r ($title); print "</pre><br />\n";
print 'Line '.__LINE__.' $fieldsObjects structure <pre>'; print_r ($fieldsObjects); print "</pre><br />\n";
print 'Line '.__LINE__.' $fieldsFormatted structure <pre>'; print_r ($fieldsFormatted); print "</pre><br />\n";
print 'Line '.__LINE__.' $plugins structure <pre>'; print_r ($plugins); print "</pre><br />\n";
The number of images is passed embedded in a formatted string in the $plugins array.
You would then need to write some PHP code to retrieve the number of images from this formatted string.
I hope this helps - Mark