Display Dublin Core title for audio files in file gallery

We are using a custom theme based on Seasons 2.7. For individual items with multiple files attached, I’d like the Dublin Core Title field to be displayed before audio player for audio files in the file gallery.

An example item:
https://lgbtqcolorado.cvlcollections.org/items/show/60

What’s the best way to do this?

1 Like

This is going to involve editing your theme, specifically the items/show.php file.

Where you have currently something like

    <?php echo files_for_item(array('imageSize' => 'fullsize')); ?>
<?php foreach ($item->Files as $file): ?>
<div>
<?php echo metadata($file, array('Dublin Core', 'Title')); ?>
<?php echo file_markup($file, array('imageSize' => 'fullsize')); ?>
</div>
<?php endforeach; ?>

That will put the Title before every file. You could test for how many files there are if you only want to do this where there’s multiple, and check the files’ mimetypes, extensions, or other metadata you have set if you want to do it only for audio.

Ah–that’s perfect. Thanks! Like most good solutions, it seems obvious in retrospect.