I am adapting an Omeka-S theme, and would like to adjust the show.phtml file to display the linked resources of an item the same way it does the item showcase block. I found the item showcase code and am trying to integrate it into the phtml page
<div class="twothirds"> <div class="item-showcase"> <?php foreach ($attachments as $attachment): ?> <div class="item resource"> <?php $item = $resource->item(); if ($item): ?> <?php $media = $attachment->media() ?: $item->primaryMedia(); if ($media): echo $item->linkRaw($this->thumbnail($media, $this->thumbnailType)); 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(); ?></h3> <?php endif; ?> <?php endif; ?> <?php $caption = $attachment->caption(); if ($caption): ?> <div class="caption"><?php echo $caption; ?></div> <?php endif; ?> </div> <?php endforeach; ?> </div> </div>
I imagine that i need to at least being with changing the line
<?php foreach ($attachments as $attachment): ?>
to be something like foreach linked item to this item with certain conditions (such as select every item that is an image that is linked to this image in this particular field)…and then each of those to be displayed as the thumbnail with the link.
However I am not sure how to call the related items. I tried to look at the DisplaySubjectValues but can’t figure it out. Any guidance would be appreciated.