Mapping Marker -- Suppressing view media link

Hi!
I’m using the mapping plugin in Omeka S to map out existing virtual pilgrimage experiences. On each mapping marker I have a thumbnail, and on the bottom there is both a “view item” link and “view media” link. I only want the “view item” link visible, but I want to include a thumbnail. Is there a way to suppress the “view media” link on mapping markers?
Thanks for your help!

1 Like

The only way to do this is to edit the file /Mapping/view/common/block-layout/mapping-block.phtml and change the following lines:

    <?php if ($marker->media()): ?>
    <img src="<?php echo $this->escapeHtml($marker->media()->thumbnailUrl('medium')); ?>">
    <div>
        <a href="<?php echo $this->escapeHtml($marker->media()->url()); ?>"><?php echo $this->translate('View media'); ?></a>
    </div>
    <?php endif; ?>

To this, if you just want to use the item’s primary (i.e. first) media:

    <?php if ($media = $marker->item()->primaryMedia()): ?>
    <img src="<?php echo $this->escapeHtml($media->thumbnailUrl('medium')); ?>">
    <?php endif; ?>

Or to this, if you want to use the specific media you configured when editing the item:

    <?php if ($marker->media()): ?>
    <img src="<?php echo $this->escapeHtml($marker->media()->thumbnailUrl('medium')); ?>">
    <?php endif; ?>

Thank you so much for your help! Unfortunately I’m a history student with no background in coding, so I don’t know how to access the phtml for the item. Would you mind explaining how I can get the code to appear for the item?

You need to connect to your server via SSH or FTP. Then open the file in a text editor, modify the code, and save it. Your hosting service or server administrator should have instructions on how to connect to your server. Sorry I can’t be any more help.

As I ended here with a very similar question, I’ll leave a note for others, should they have the same need.

I wanted to remove the direct link to the media from the main map page of the website, usually located at example.com/s/yoursite/map-browse

To do it, I had to edit a different file, namely:

Mapping/view/mapping/site/index/browse.phtml

and then remove or comment out the following line:

<a href="<?php echo $this->escapeHtml($marker->media()->url()); ?>"><?php echo $this->translate('View media'); ?></a>

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.