Overview

This is a personal note on how to retrieve the URL of site pages where items are published in the Omeka S OaiPmh Repository module.

Background

The following article introduces how to create custom vocabularies using OaiPmhRepository.

https://nakamura196.hatenablog.com/entry/2021/07/25/222651

Please refer to it as well.

Retrieving the URL of Site Pages Where Items Are Published

Before Fix

In a certain customization case, the site page URL was retrieved as follows. This does not work properly when something other than dcterms:identifier is configured in the Clean URL module. Additionally, hardcoded paths like /s/db/record/ can be seen.

i}f($$tihtiesm-->>avpapleuned(Ne"wdEclteemremnst:(i$doeanit,if'iceurr"at)io)n:{relation',self::prefix."/s/db/record/".(string)$item->value("dcterms:identifier")->value());

After Fix

It was possible to write it more simply as follows. This also handles cases where the item is published on multiple sites.

$f}soirteea$$scsthih=ti(es$$S-isl>tiuaetgpmep-s=e>nsa$dissNtiee$twskeE(e-l)y>e;sm=le>ungt$((s)$i;otaei),{'curation:relation',$item->siteUrl($siteSlug,true));

Summary

I hope this serves as a useful reference for building an OAI-PMH repository with Omeka S.