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 described File as link header for Media Entities #681

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

Expose described File as link header for Media Entities #681

dannylamb opened this issue Jul 12, 2017 · 1 comment

Comments

@dannylamb
Copy link
Contributor

dannylamb commented Jul 12, 2017

Every time a media is viewed, check its fields for a referenced file or image (currently field_file or field_iage) and expose the file's URL as a link header.

You have access to the media and can add link headers in hook_media_view_alter like so:

function islandora_media_view_alter(&$build, EntityInterface $media, EntityViewDisplay $display) {
  $build['#attached']['http_header'] = [
    ['Link', '<http://islandora.ca>; rel="awesome"'],
  ];
}

Use "describes" for the link header's rel value.

@dannylamb
Copy link
Contributor Author

Duplicate of #721

@dannylamb dannylamb marked this as a duplicate of #721 Jan 5, 2018
dannylamb pushed a commit to dannylamb/CLAW that referenced this issue Feb 8, 2018
…ra#681)

* ISLANDORA-1998 Check correct permission for replace ds link.

* Remove redundant theme check.
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