Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Issue 1193: Document display hints #1222
Changes from 2 commits
4c938ba
63cebed
a1792e2
0d5d6fa
5667c05
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, addressed.