Change Item Display Order according to 'Item Type'

Hello,

I’m looking to change the display order of an item’s ‘Files’ and ‘Dublin Core’ elements depending on the ‘Item Type’.

For our ‘Oral History’ and ‘Moving Image’ Item Types we’re embedding links to Soundcloud and Vimeo/Youtube, the iframe html being added in the Dublin Core ‘Source’ field (which I’ve asked Omeka to display first). In order to give the item a thumbnail, an additional image is then added as a file.

For both ‘Oral History’ and ‘Moving Image’ item types, I’d like to amend the Emiglio theme’s Items/show.php so that the Dublin Core metadata is displayed before any files, allowing viewers to see the embedded content first.

I’m afraid my attempts at PHP so far have been failures, the passage I’ve been looking at is this:

    <?php if ((get_theme_option('Item FileGallery') == 0) && metadata('item', 'has files')): ?>
<div id="itemfiles" class="element">
    <?php echo files_for_item(array('imageSize' => 'fullsize')); ?>
</div>
<?php endif; ?>
<?php echo all_element_texts($item); ?>    

Many thanks,
John

Just in case anybody may be interested, I’ve bodged the following which looks to have worked.

I’ve created a variable $embed_media to check whether the Dublin Core ‘Source’ field is populated, reordering the display order accordingly:

<?php $embed_media = metadata($item, array('Dublin Core', 'Source')); ?>

    <?php if ((get_theme_option('Item FileGallery') == 0) && metadata('item', 'has files') && ($embed_media)): ?>
        <?php echo all_element_texts($item); ?>
            <div id="itemfiles" class="element">
                <?php echo files_for_item(array('imageSize' => 'thumbnail')); ?>
            </div>     
       
    <?php elseif ((get_theme_option('Item FileGallery') == 0) && metadata('item', 'has files')): ?> 
        <div id="itemfiles" class="element">
           <?php echo files_for_item(array('imageSize' => 'fullsize')); ?>
        </div>
           <?php echo all_element_texts($item); ?>

           <?php else: echo all_element_texts($item); ?> 
    <?php endif; ?>
1 Like