Opening embedded media files in a new tab?

Hello all:

I am using the Foundation theme. Does anyone have any advice on what to edit in the code so that when a user clicks on an embedded file (image, PDF, etc.) on item pages, it opens in a new tab?

Thank you for your help.

Hmm, it sounds like what you want is a target="_blank" attribute on the link… I don’t think we have an extremely easy option for just changing that.

The item page view is view/omeka/site/item/show.phtml (copy from the core if your theme doesn’t have one). You’d probably be looking at changing the part of the view that calls $media->render(). You can change that to $media->render(['link' => false]) to remove the default link we add, and then add your own that includes the target="_blank" part (the URL to the original you can get by calling $media->originalUrl() ).

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