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 a rel=type link header to Node and Media GET responses #720

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

Add a rel=type link header to Node and Media GET responses #720

dannylamb opened this issue Sep 21, 2017 · 0 comments
Labels
Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org

Comments

@dannylamb
Copy link
Contributor

Add a rel=type link header to Node and Media GET responses for each rdf:type defined in the rdf mapping for its respective bundle.

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

Media don't have a specific alter, but you can use hook_entity_view_alter to achieve the same effect.

@kstapelfeldt kstapelfeldt added Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org and removed drupal labels Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org
Projects
Development

No branches or pull requests

3 participants