Setting up the same thumbnail for an item type or set

Hi,
I am working on Omeka S 3.2.3 and we have an item set of people (class: Person) and would like to apply the same thumbnail for all of them. In the media we have their bio, so we don’t want to upload the same image and override that.

Is there a batch way to set the same thumbnail for a particular item set, or do I need to change how the various pieces of code that generate thumbnails for that item handle it? For example changing linked resources code to put a particular thumbnail if it encounters a class person (changing the linkPretty() call?

Thank you

If you use the custom thumbnail feature, you don’t have to upload the same image multiple times, you can just choose the same existing asset. But you’d have to choose it for each item.

If you were going to try to override or customize something to change the default thumbnail, the place to do it would probably be the Thumbnail helper, or possibly thumbnailDisplayUrl() in the Representation class.

Thanks @jflatnes, we love the thumbnail feature for that reason, the ability to reuse a single image. Is there a way to batch assign it to a set of items?

Are the thumbnail helper or thubmanilDisplayUrl() something that can be customized by theme, or is that in the root application? Previously I have tried rewriting sections of the item showcase block:

`

<?php foreach ($attachments as $attachment): ?>
<div class="item resource">
<?php
$item = $attachment->item();
if ($item):
?>
    <?php
    $media = $attachment->media() ?: $item->primaryMedia();
    if ($media): //changed from media
        echo $item->linkRaw($this->thumbnail($item, $this->thumbnailType,['alt'=>$item->displayTitle(),'class'=>'squareimage']), null, [
            'class' => 'squarecontainer'
        ]);//changed from media
    else:?>
          <img src="custom image link"/> <!--only for retags-->
    <?php endif; ?>
   <?php $showTitleOption = $this->showTitleOption; ?>
    <?php if ($showTitleOption == 'item_title'): ?>
    <h3><?php echo $item->link($item->displayTitle()); ?></h3>
    <?php elseif ($showTitleOption == 'file_name'): ?>
    <h3><?php echo $media->displayTitle(); ?>
    <?php endif; ?>
<?php endif; ?>

Though i guess if i want to just adjust a theme to maintain the thumbnail throughout a site, i would have to go through all the different blocks and codes (like linked-resources.phtml) to adjust…

Thanks for your time

Hi,

So I might have made some progress in the linked-resources.phtml by doing the following:

<tr class="linked-resource">
        <td>
            
        <?php if ($value->resource()->resourceClass()->label() == "Person"):?>
            <img src="COMMON THUMBNAIL LINK"/>
            <?php $heading = $value->resource()->displayTitle();?>
            <span class="resource-name"><?php echo $value->resource()->link($heading); ?></span>
        <?php else: ?>
            <?php echo $value->resource()->linkPretty('square', null, null, null, ($filterLocale ? $lang : null)); ?>
        <?php endif;?>

However, a further complication, for some of these items we have added a custom thumbnail. I want to add a further conditional to test to see if there is a thumbnail already for that item and tell the system to still use that one, and then only use this common one. I know I can call hasThumbnails() for media, but in this case I want to access the Item’s thumbnail value.

Should i search for the value('thumbnail_display_urls') and check if it is just using the default omeka one for that type /application/asset/thumbnails/default.png?v=3.2.3;/application/asset/thumbnails/default.png?v=3.2.3;/application/asset/thumbnails/default.png?v=3.2.3 or a custom one to be able to make the if statement work?

Thank you,
Sanjin