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 rel=related link header to Node GET and HEAD responses #716

Closed
dannylamb opened this issue Sep 21, 2017 · 0 comments
Closed

Add rel=related link header to Node GET and HEAD responses #716

dannylamb opened this issue Sep 21, 2017 · 0 comments
Assignees

Comments

@dannylamb
Copy link
Contributor

dannylamb commented Sep 21, 2017

Add a rel=related link header to Node GET responses, pointing to all referenced entiies. The 'title' of the link header should be the name of the entity reference field. This way, we can navigate the repository using link headers, finding derivatives or parent collections, etc...

You have access to the node and can add link headers in hook_node_view_alter like so:

function islandora_node_view_alter(&$build, EntityInterface $node, EntityViewDisplay $display) {
  $build['#attached']['http_header'] = [
    ['Link', '<http://islandora.ca>; rel="awesome"'],
  ];
}
@dannylamb dannylamb changed the title Add rel=describes link header to Nodes Add rel=describes link header to Node GET responses Sep 21, 2017
@dannylamb dannylamb changed the title Add rel=describes link header to Node GET responses Add rel=describes link header to Node and Media GET responses Sep 21, 2017
@dannylamb dannylamb changed the title Add rel=describes link header to Node and Media GET responses Add rel=describes link header to Node GET responses Sep 21, 2017
@dannylamb dannylamb changed the title Add rel=describes link header to Node GET responses Add rel=related link header to Node GET responses Jan 2, 2018
@dannylamb dannylamb changed the title Add rel=related link header to Node GET responses Add rel=related link header to Node GET and HEAD responses Jan 2, 2018
@dannylamb dannylamb self-assigned this Jan 2, 2018
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