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

Add URL Aliases and Breadcrumbs docs. #2299

Merged
merged 3 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/assets/breadcrumbs-config-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/breadcrumbs-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/user-documentation/breadcrumbs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Breadcrumbs

Breadcrumbs are a Drupal concept. They provide a hierarchical path
of links to "ancestors" of the current content item.

![example of breadcrumbs](../assets/breadcrumbs-example.png)

## Islandora Breadcrumbs

Islandora provides a module, "Islandora Breadcrumbs" (a submodule
of the Islandora module) that creates breadcrumbs based on the value
of configured reference fields (by default, `field_member_of`).
To use Islandora Breadcrumbs, simply enable
the module. Islandora breadcrumbs will apply to nodes that have
the configured Entity Reference fields.

There are a few configuration options for this module, accessible at
**Manage** > **Configuration** > **Islandora** > **Breadcrumbs
Settings** (`/admin/config/islandora/breadcrumbs`). These include:

* Maximum number of ancestor breadcrumbs - an optional feature to
stop adding "ancestor" links after a certain number
* Include the current node in the breadcrumbs?
* Entity Reference fields to follow - if you're using other fields
to refer to parents, you can add them here.

![configuration screen](../assets/breadcrumbs-config-screen.png)

## Troubleshooting Breadcrumbs

Breadcrumbs are cached, so if you aren't seeing the results that
you expect, try clearing the Drupal cache.
51 changes: 51 additions & 0 deletions docs/user-documentation/url-aliases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# URL Aliases

A URL alias is an alternate URL pattern that resolves to a Drupal entity,
such as a node, media, taxonomy term, or user. For example, you could set
"/welcome" as an alias for "/node/1". Aliases are part of Drupal Core and
can be extended by contrib modules. One such module is Pathauto, which
enables automatic alias generation based on patterns, and the patterns may
involve "Tokens" (such as [node:title]).

This page will attempt to cover the Islandora Starter Site's use of aliases
and what we consider to be best practices. A full description of creating
and managing aliases is out of scope.


## Best practices with URL aliases

While every site may choose to set up their aliases differently, we cannot
prescibe a universal setup.

A common "nice-to-have" is the presence of the slug `/islandora/` in the
URL which identifies the content as "Islandora".

A potential "best practice" is that if your site uses persistent identifiers
such as DOIs or Handles, that those identifiers make up part of the URL alias.


## Use of URL aliases in Islandora Starter Site

The Islandora Starter Site includes the Pathauto module, which we consider
that most sites will want to use in some way. However its default configuration
should not be interpreted as prescriptive. You are encouraged to use persistent
identifiers if you have them!

The default Pathauto pattern for Repository Items is `/islandora/[node:title]`
with the pathauto configuration trimming the alias at 100 characters.


## Preserving Legacy URLs

Sites migrating from Islandora Legacy may wish for their objects to still
be available through their old URLs, with the pattern `/islandora/object/[PID]`.

Options for doing this include:

* Populating `field_pid` with the legacy PID, and using Pathauto to create URL
aliases of the pattern `/islandora/object/[node:field_pid]`. However, you will
need to set up something for new objects that don't have Legacy PIDs.
* Use discoverygarden's ["PID Redirect"](https://github.com/discoverygarden/pid_redirect)
module, which creates "301 Moved Permanently" redirects from legacy URLs to
the appropriate node, based on `field_pid`.
* Manually managing redirects in your webserver.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ nav:
# Conceptual and pragmatic, for repository managers.
- Administering Islandora:
- 'Access control': 'user-documentation/access-control.md'
- 'Breadcrumbs': 'user-documentation/breadcrumbs.md'
- 'JWT authentication': 'user-documentation/jwt-authentication.md'
# moved from Developer documentation
- 'URL Aliases': 'user-documentation/url-aliases.md'
- 'Usage statistics': 'user-documentation/usage-stats.md'
# largely conceptual, repository managers
- 'Versioning': 'user-documentation/versioning.md'
Expand Down
Loading