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 1193: Document display hints #1222

Merged
merged 5 commits into from
Jul 22, 2019
Merged

Issue 1193: Document display hints #1222

merged 5 commits into from
Jul 22, 2019

Conversation

mjordan
Copy link
Contributor

@mjordan mjordan commented Jul 18, 2019

GitHub Issue: (#1193)

What does this Pull Request do?

Updates the user docs to explain how display hints work and how to configure them.

What's new?

Updated objects.md, plus two additional screenshots.

How should this be tested?

  • Check it for accuracy and clarity.

Interested parties

@manez, @Islandora-CLAW/committers

docs/user-documentation/objects.md Outdated Show resolved Hide resolved

Finally, save your Context. From that point on, whenever the media for a node has the configured Mime type, Drupal will render the media using the corresponding view mode.

The node-level and global approaches are not exclusive to one another. You can configure the view mode globally and override it at the node level if you want.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't entirely correct as one Context can override the other depending the order of execution. Whichever condition is checked last between the "node-level" condition (has-term-based) the "global" (mime-type-based) will override the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I avoided the ordering topic intentionally so as not to get too far into the weeds. But, if we think it's important to document that here, I will do so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think it is important to bring up if you have multiple contexts that impact the same display view mode. (Related comment.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, addressed.


The selected view mode will then be used when the node is viewed.

At a global level, you can create a [Context](context.md) that will detect the media's Mime type and use the configured view mode automatically. To do this, go to Drupal's "Structure" menu, then "Context" and create a new Context. Then, add a "Media has Mime type" condition and specify the Mime type, and add a "Change View mode" Reaction that selects the desired view mode:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the most appropriate way to do this is to modify the existing Context condition that already exists for the display view mode. E.g. if we want use the PDF mimetype to trigger the PDFjs view mode they should edit the existing one (/admin/structure/context/pdfjs) and add the mimetype condition. As long as "Require all conditions" is not selected, either the mimetype or display mode radio button will trigger the display mode update.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it more clear to an admin that we already have a condition to do this but we are adding an additional capability that alleviates us from needing to select the view mode explicitly.

Perhaps the more common example would be openseadragon where we want to use the mimetype for JP2 but we can manually select it for regular JPEGs if desired.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that there are benefits to modifying the existing context, but I think whether or not an admin decides on doing that or creating a new context is probably a matter of personal preference. Your suggested example of an override is good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to document modifying the existing context but I'd like to mention that there are two ways of doing it. But, that might be too far into the weeds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fine. I just didn't want new admins to create a new context without realizing that a similar one already exists, especially because creating a separate one could lead to the context ordering issue mentioned in the other thread.

Perhaps you could lead with the modification example and then follow-up with the "you can add an additional, separate, condition; but keep in mind that the order of context processing may cause one to override the other" (or something to that effect).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both approaches are described now.

Copy link
Member

@manez manez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from me

@seth-shaw-unlv seth-shaw-unlv merged commit 3cecf50 into Islandora:master Jul 22, 2019
@rosiel rosiel mentioned this pull request Dec 4, 2020
8 tasks
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.

3 participants