-
Notifications
You must be signed in to change notification settings - Fork 51
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
[BUG] Related items links do not open in new tab #5808
Comments
Discussion happened about whether this should live in the manifest or as a Ramp default; it was decided to put this into the manifest. Generally we have an icon for when links open in a new tab. Can we add that in Ramp, and by what method? IIIF Spec says: we could add an image tag to the hyperlink in the manifest, but this could also be in the Ramp. |
After the discussion, I looked at other IIIF viewers to see how they handle linked metadata and saw the following behaviors in different viewers;
In all these cases the IIIF Manifest the metadata with links have not specified Even though my intuition was not to implement this on the Ramp side, since it's only suppose display what's in the IIIF manifest, and I was wrong? @joncameron and @cjcolvar What are your thoughts? |
Even though it's the behavior in those viewers I'm not convinced that opening links in new tabs/windows should be a default behavior in Ramp. I read through some resources on this:
The general recommendation is to not break default behavior, and in almost all cases open links in the current tab or window. I feel comfortable sticking with that, and keeping the attribute to open a new tab just in Avalon's manifest generation rather than as something determined by Ramp. An enhancement that might make this behavior better (active media playback is called out in some of the articles above as to why you might want to open links in a new context) is to retain more state in Ramp, so if a user clicks a hyperlink that opens in the current tab or window going Back in the browser returns to the media player to where it was, going back to the section and timepoint at which the user left it. I'm not sure if there's an issue for this but I can create one if not. Another improvement that could be made here is adding "(opens in new tab)" text to the link label, as recommended in MDN and other resources. |
While working on implementing the solution to include |
I looked at the other viewers to see how they handle this in the rights statement cookbook recipe:
Looking at these, I think we could keep the behavior of any attributes that comes with any HTML in the Manifest as it is. i.e. if the value has any HTML tags in it, do not modify it except filtering any unsupported HTML attributes in it. As for any values that are URLs presented as strings, I think we can handle them any way we like looking at what others are doing. But, for consistency as well and considering the resources Jon found, I think we can let them open in the same tab? What do you think @cjcolvar ? |
I think that is fine and would close this ticket 🙂 . If a user clicks a link that they were expecting to open in a new tab and it opens in same tab then going back to get back to the player is pretty easy. Doing this during playback may cause them to lose their place when they return to the player. If ramp were able to store/restore the playback state that would fix this. |
I'm for that as well! This seems reasonable, and if needed we could always add the injection method into Ramp for a tags with target=_blank at some later point if needed. I created samvera-labs/ramp#519 for storing and restoring playhead position state. |
Describe the bug
Related item links do not open in a new tab.
To Reproduce
Steps to reproduce the behavior, including the results:
Expected behavior
Related item links open in a new tab.
Release:
Occurs in 7.7+
Additional notes
This change in behavior comes in 7.7 since Ramp renders what's in the manifest and the manifest creates simple
<a>
elements without atarget="_blank"
attribute. This could either be fixed in the manifests Avalon generates and/or in Ramp by dynamically adding this attribute to certain links (metadata, homepage, etc.). It was decided that Ramp should be agnostic here and not open anything in a new tab unless explicit in HTML contained in the manifest.See https://webaim.org/techniques/hypertext/hypertext_links#new_window.
Done Looks Like
The text was updated successfully, but these errors were encountered: