Daniel-KM / Omeka-S-module-CleanUrl

Displays clean and readable URLs like https://example.org/my_collection/dcterms:identifier in Omeka S.
Other
4 stars 4 forks source link
identifier omeka-s omeka-s-module seo-friendly

Clean Url (module for Omeka S)

New versions of this module and support for Omeka S version 3.0 and above are available on GitLab, which seems to respect users and privacy better than the previous repository.

Clean Url is a module for Omeka S that creates clean, readable and search engine optimized URLs like https://example.com/my_item_set/dc:identifier instead of https://example.com/item/internal_code. Used identifiers come from standard Dublin Core metadata, or from any specific field, so they are easy to manage. It supports Ark and short urls too.

Furthermore, it makes possible to use a main site and additional sites, like in Omeka Classic, so the main site won’t start with "/s/site-slug". The slug "/page/" can be removed too, or replaced by something else. The urls from Omeka Classic can be recreated easily too, so old urls can still be alive.

This Omeka S module was initially based on a rewrite of the Clean Url plugin for Omeka and provide the same features as the original plugin and many more.

Installation

This module uses the optional module Generic, that may be installed first.

See general end user documentation for installing a module.

Uncompress files and rename module folder CleanUrl.

Then install it like any other Omeka module and follow the config instructions.

IMPORTANT: The module copies one file in the main config directory of Omeka, "cleanurl.config.php". this is a list of all reserved words for the first level of the url, when there are no site and page prefixes. All common routes are included. It is larger than needed in order to manage future modules or improvments, according to existing modules in Omeka classic or Omeka S or common wishes. Furthermore, it contains the list of site slugs and some other settings in order to manage routing quickly, in particular when there are no site and page paths. Contrary to a previous version, this file is automatically updated and should not be updated manually.

Usage

Clean urls are automatically displayed in public theme and they are not used in the admin theme. They are case insensitive by default.

This module may be used with the module Archive Repertory to set similar paths for real files (item_set_identifier / item_identifier / true_filename).

IMPORTANT: In all cases, it is recommended to use unique identifiers through sites, pages, item, item set, media. and any other resources.

Main site

In some cases, Omeka S is used like in Omeka Classic, with a main site and some exhibits or decentralized sites (see omeka/omeka-s#870). In such cases, the prefix "/s/site-slug" is useless and not seo and user friendly. An option is available in the config form to remove it.

Sites and pages

Options are available to replace or remove the s/ and the page/ in order to get these urls:

- / [ s/ ] :site-slug / [ page/ ] :page-slug
- / [ s/ ] :site-slug / :page-slug
- / :site-slug
- / :page-slug (for main site)

Of course, be aware that some conflicts are possible in particular for pages, even if some slugs are reserved. A check is done when creating sites and pages to avoid issues.

Identifiers

Simply set an identifier for each record in a field. The recommended field is Dublin Core:Identifier.

Structure of urls

The configuration page let you choose the structure of paths for item sets, items and files.

Each resource can have a default path, a short path, and additional paths, or not. Multiple urls can be set, in particular to have a permalink and a search engine optimized link. It is not recommended to multiply them.

Paths are simple string where you can set the type of identifier you want between {}. Managed identifiers are:

So an example for a document within an item set may be collection/{item_set_identifier}/{item_identifier}.

Note that if you choose to include the item set in the path, all items should have an item set and all item set should have an identifier.

The identifier of the media can be the position. When used, it is recommended to specify a format with a leading letter to avoid confusion with numeric media id, for example p{media_position}. Furthermore, the position may not be stable: a scanned image may be missing. Finally, if the first media is not marked "1" in the database or if the positions are not the good one, use module Bulk Check to fix them. Anyway, the identifier can be the content of any property, as long as its content is unique for the list of media of the item.

Config for Ark

The module Ark allows to create normalized unique identifiers formatted like ark:/12025/b6KN, where the "12025" is the id of the institution, that is assigned for free by the [California Digital Library] to any institution with historical or archival purposes. The "b6KN" is the short hash of the id, with a control key. The name is always short, because four characters are enough to create more than ten millions of unique names.

There are multiple way to config arks:

Other options are at your convenience.

Config for Omeka Classic compatibility

If you upgraded from Omeka Classic and you want to keep a redirection from your current urls:

TODO

Warning

Use it at your own risk.

It’s always recommended to backup your files and your databases and to check your archives regularly so you can roll back if needed.

Troubleshooting

See online issues on the module issues page on GitLab.

License

This module is published under the CeCILL v2.1 license, compatible with GNU/GPL and approved by FSF and OSI.

In consideration of access to the source code and the rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software’s author, the holder of the economic rights, and the successive licensors only have limited liability.

In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user’s attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom.

Copyright

First version of this plugin has been built for École des Ponts ParisTech. The upgrade for Omeka 2.0 has been built for Mines ParisTech. The upgrade for Omeka S was built by BibLibre for Paris Sciences et Lettres (PSL). Then, the module was rewritten to manage various requirements.