Hi all,
i’m new to Omeka S and php coding and i’m trying to improve an Omeka S backend for a local archive.
An archivist asked me if it’s possible to insert navigation buttons in the show item page.
We’d like to insert a previous and next button to navigate between the items of the same father item-set.
The ordering of the items is an integer resource value (we used rdf:value).
The idea was something like this:
<div class="meta-group">
<h4><?php echo 'Navigation; ?></h4>
<div class="value item-sets">
<?php
//get the number of the item
$number = item->value(rdf:value);
//get the father item-set (the only one with the "Collection" class)
$itemsets = $item->itemSets();
foreach ($itemsets as $itemset){
if ($itemset->displayResourceClassLabel() == 'Collection') $fatherset = $itemset;
}
//get all the items contained in $fatherset in the $items variable
?
?
?
//select the next and the prev
foreach ($items as $obj) {
if ($obj->value(rdf:value) == $number + 1) $next = $obj;
if ($obj->value(rdf:value) == $number - 1) $prev = $obj;
}
//echo the links
echo $prev->link('Previous');
echo $next->link('Next');
?>
</div>
</div>
Now i don’t know how to obtain the vector/array of items contained in the $fatherset (??? lines).
Is there a way “in the API’s way” like with the search query call? i don’t think i need to use an API request in a php web page generating though…right?
Thank you all very muchh,
Andrea.