Export or display "omeka S resource id"

How can I see an item’s “omeka s resource id?” I’m assuming this is the number that appears after example.com/item/? Is there a way to display that number in the items page in admin, export it, or even edit it? thank you.

I think it would be a fairly simple thing for a module to that info either on the item show page or in the details on the browse page.

That might be overkill, though, since you are correct that it’s the number after item/?.

I’m not quite sure what kind of export you have in mind, or what is needed for. You can grab all the data from the API if you want, and that will contain the resource ids. Would that get at your needs?

There isn’t a way to edit it, since those ids are also the ids in the database, so changing the id would break all the database linkages.

I need the item numbers to make use of the “omeka resource id” option during csv import. One of the fields has “property” that is set for existing omeka items. Without having the list that shows me items and their item #'s, I currently manually doing search/find for each. I hope I am making sense.

I think so. It sounds like the quickest/easiest solution is a small module that displays item IDs in the details sidebar on browse items pages. That’d let you do a search on items by whatever criteria, then go through and open the details sidebar for each one that you want the ID from.

That’s only marginally better than reading it off the URL displayed in the browser when you hover over the link, but might be something.

Trying to do an export that lines up only the info you need sounds complicated enough that some manual work just typing in the ids after you do the search is probably going to be faster in the long run.

A basic module that’d show the IDs in the details sidebar would look something like this:


<?php

namespace Eventfull;

use Omeka\Module\AbstractModule;
use Zend\EventManager\SharedEventManagerInterface;

class Module extends AbstractModule
{
    public function attachListeners(SharedEventManagerInterface $sharedEventManager)
    {
        $sharedEventManager->attach(
            'Omeka\Controller\Admin\Item',
            'view.details',
            [$this, 'showId']
            );
    }

    public function showId($event)
    {
        $item = $event->getParam('entity');
        $id = $item->id();
        echo "<div>ID: $id</div>";
    }
}

The name of the module and namespace would likely be different, and you’d need to add a config/module.ini file, but that puts the data in the sidebar, at least, so it’s a smidge more accessible in one screen.