Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use just part of field as identifier #7

Open
tuxedobyrd opened this issue Jul 16, 2016 · 1 comment
Open

How to use just part of field as identifier #7

tuxedobyrd opened this issue Jul 16, 2016 · 1 comment

Comments

@tuxedobyrd
Copy link

I have some records in Omeka that describe multiple items in our collection. For example, I have one record for an interview that is on two tapes with a transcript and so I have three DC:Identifier fields with the object ID numbers we use locally for the items and a parenthetical explanation. The fields are "2001.037.0017 (Tape 1)", "2001.037.0018 (Tape 2)", and "2001.037.0001 (Transcript)".

What I would like to do in cases like this is have just the number part from the first identifier be the clean url, so my clean url would be "example.com/collection_identifier/2001.037.0017" but I still want the parenthetical part to display on the items page. It seems like I should be able to simply modify the $sqlSelect line in the GetRecordIdentifier.php file so that it selects only the part of the string before the first space (if a space exists). I have tried to use strtok and a few other functions to accomplish this, but just can't seem to get it done. Any nudge in the right direction would be greatly appreciated.

I am not using prefixes so there is no complication there.

@Daniel-KM
Copy link
Owner

Daniel-KM commented Jul 17, 2016

Hi,

On my point of view, the simplest is to add another id with a prefix:

Tape 1: 2001.037.0017

or

Document: 2001.037.0017

so there is no need to hack and this avoids possible future issues when the dc:identifier will be reordered, for example if somebody wants to set the transcription as the first dc:identifier. And there should be a different identifier for the item as a whole and each part of it in order not to be confused (so the main id should not be 2001.037.0017).

To keep the same data, a new option should be added to the plugin to use a suffix ((Tape 1) here), but it means some work: everywhere you find "prefix" in the plugin, add some code to use a "suffix"...

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants