We can access through simple search to the detail/metadata of a single file (the URL is for instance /files/show/1). In that case, I would like to get and display informations about the parent item, and if possible the parent collection of this file.
Is it possible with omeka 2.0 ?
I'm pretty sure this can be done with a little customization to the theme's files/show.php
file. (See the guide to modifying themes to get started)
You would first dig up the item id, then get the item itself and make it the current record like so:
<?php
$item_id = metadata('file', 'item_id');
$item = get_record('item', $item_id);
set_current_record('item', $item);
?>
Then you can copy what you want from items/show.php
into files/show.php
to display what you want. You'll see the lines in items/show.php
that display collection information for the item
Really great and many thanks, I can get it like this :
<?php
$item_id = metadata('file', 'item_id');
$item = get_record_by_id('item', $item_id);
set_current_record('item', $item);
echo metadata('item', array('Dublin Core', 'Title'));
?>