How to manually loop through files attached to an item?


#1

I am trying to display metadata attached to an item. After some finicking, I’ve managed to display each title individually using the code below, but am unsure of what to reference besides the standard array to display the associated files:

$itemFiles = $item->Files;
        foreach($itemFiles as $itemFile): ?>
                echo metadata($itemFile, array('Dublin Core', 'Title'))
                echo files_for_item(array('imageSize' => 'fullsize'));
        endforeach;

The tester page I’m working on is meant to display an image, an audio file, and a video. The code above displays all three files, but it does so underneath each title.

What would the syntax be for displaying individual files?


#2

files_for_item, as you’ve seen, prints all the files for an item. file_markup is the function to use to print one specific file.