Hello, I was wondering if there was any way to tell the display_files_for_item helper to only display a certain type of file. For example--I only want it to display .jpg files on the public item show page even though there are other types of files associated with the item.


You can check to see if the item has a thumbnail to display image files in something like this below:

<?php while ($file = loop_files_for_item()): ?>
<?php if ($file->hasThumbnail()): ?>
<?php if ($index == 0): ?>
<?php echo display_file($file, array('imageSize'=>'fullsize'), array('class' => 'fullsize')); ?>
<?php else: ?>
<?php echo display_file($file, array('imageSize'=>'square_thumbnail', 'linkToFile'=>true), array('class' => 'square_thumbnail')); ?>
<?php endif; ?>
<?php endif; ?>