Universal Viewer: turn off for some item types

Hi all,

This has been sort of discussed before (https://forum.omeka.org/t/different-viewers-for-different-item-types/7866, but I’m apparently not savvy enough to do this and I’d be so grateful for any help.

How do I set the Universal Viewer plugin to only appear for a specific item type? From what I understand, I should put an ‘if’ into the item/show.php, but all I seem to do is break those item types. So:

  1. Do I need to add anything anywhere else?

  2. Is this anywhere close to correct? (I mean, it isn’t, since it doesn’t work… where am I going wrong?)

<?php if (metadata('item', 'Item Type Name') ! = 'Publication'): ?>
<?php get_specific_plugin_hook_output('UniversalViewer', 'public_items_show', array('record' => $item, 'view' => $this,)); ?>
<?php endif; ?>

Thanks for any help!

I use the following to display UV. I’m not certain if it is the best way but it works.

echo $this->universalViewer($item, $options);

I use it to display UV based on file mime type.
Hope this helps!

Thank you! I’ll try this!

1 Like