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

Expose OBJ media as link header #679

Closed
dannylamb opened this issue Jul 12, 2017 · 1 comment
Closed

Expose OBJ media as link header #679

dannylamb opened this issue Jul 12, 2017 · 1 comment

Comments

@dannylamb
Copy link
Contributor

Every time a node is viewed, check to see if it has field_obj, and if it does, add the url to referenced entity as a link header.

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"'],
  ];
}

We don't have any defined rel types at the moment, so just use something like obj and we'll mint something official in a subsequent ticket.

@dannylamb
Copy link
Contributor Author

Closing since I'm about to make a batch of tickets to supersede this and then some.

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

1 participant