I have a PDF Text plugin installed, so when a user does search something, he or she gets a mix of items and PDF files. Now the link from search results points to an item page, and I want to change that: in such case when a search result is a file, I want to show a direct link to this PDF.
But I don’t understand, how to get a file URI. When I need, for example, a description, I do like this:
$description = metadata($record, array(‘Dublin Core’, ‘Description’), array(‘snippet’ => 150));
Here I use known record property.
Manual says that every plugin can have its own list of properties, but I couldn’t find any such list for this plugin — and for files at all.
I found only this: https://omeka.readthedocs.io/en/latest/Reference/libraries/globals/metadata.html
Many records have special additional properties that are available as well:
- Collection
total_items
- File
uri
fullsize_uri
thumbnail_uri
square_thumbnail_uri
permalink
display_title
But I couldn’t use any of these properties. I tried something like this:
$uri = metadata($record, array(‘Pdf Text’, ‘uri’), array(‘all’));
$uri = metadata($record, array(‘Dublin Core’, ‘uri’), array(‘all’));
But I always get an error like “no such elements”.