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

Issue #973 Add hooks to IIIF manifest Views Style plugin. #938

Merged
merged 3 commits into from
May 9, 2023

Conversation

alxp
Copy link

@alxp alxp commented Apr 21, 2023

GitHub Issue: [FEATURE] Add hooks to let other modules modify IIIF manifest

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.)

What does this Pull Request do?

Allows other modules to modify the IIIF manifests via Drupal hooks.

What's new?

Two hooks, one to allow modules to modify the IIIF manifest after it is fully generated but before it is serialized to JSON. Another to modify each Views result row individually.

Also adds a getRequest() method to the plugin class so the request object protected variable can be accessed.

  • Does this change add any new dependencies? No
  • Does this change require any other modifications to be made to the repository No
  • Could this change impact execution of existing code? No

How should this be tested?

In any .module file, create a function called [modulename]_islandora_iiif_manifest_alter(&$json, &$views_plugin). Clear your cache and see that the hook gets run.

Documentation Status

  • Does this change existing behaviour that's currently documented? No
  • Does this change require new pages or sections of documentation? No
  • Who does this need to be documented for? N/A
  • Associated documentation pull request(s): ___ or documentation issue ___

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

Interested parties

Tag (@ mention) interested parties or, if unsure, @adam-vessey @Islandora/committers

@wgilling wgilling self-requested a review May 3, 2023 17:17
@wgilling
Copy link

wgilling commented May 8, 2023

after bringing in this code, adding a custom hook to do something in the hook, and navigating to an object's manifest, the code executes my custom hook code.

@wgilling wgilling merged commit 48b73c5 into 2.x May 9, 2023
@rosiel rosiel deleted the issue-973-islandora-iiif-hooks branch June 28, 2023 12:53
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

Successfully merging this pull request may close these issues.

2 participants