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

Update rich text streamfield blocks to open external links in a new tab #8002

Closed
1 task done
kristinashu opened this issue Dec 10, 2021 · 5 comments · Fixed by #8195
Closed
1 task done

Update rich text streamfield blocks to open external links in a new tab #8002

kristinashu opened this issue Dec 10, 2021 · 5 comments · Fixed by #8195
Assignees

Comments

@kristinashu
Copy link

kristinashu commented Dec 10, 2021

Follow up from - [PNI] Make external links open in a new tab #7878

We've started testing to see if opening external links in a new tab affects our analytics around bounce rate and sessions in a positive way. tl;dr is yes so we've have decided to expand this to include universal new-tab link behaviour from the rich text streamfield component in order to update this across the entire CMS.

  • All rich text streamfield blocks open external links in a new tab
@mattcfilbert
Copy link
Contributor

I don't have the full context, but is there an easy way to manually update the links in the rich text?

If not, may be worth looking into leveraging an HTML serializer like this one to automatically add the target="_blank" attribute to each link.

@Pomax
Copy link
Contributor

Pomax commented Dec 21, 2021

There is not, and while we can always hack something together, this is CMS-managed content and templates so the first step is to see if the Wagtail folks have ideas here.

@tbrlpld
Copy link
Collaborator

tbrlpld commented Jan 31, 2022

I just wanted to raise that the "open in new tab/window" behaviour is not recommended from a usability and accessibility stand-point. Especially low-vision users might miss that a new tab has been opened.

There are use cases when the "new tab/window" behaviour is beneficial (e.g. while filling a form), but these are context dependent and don't apply to all situations.

See also:

@tbrlpld
Copy link
Collaborator

tbrlpld commented Jan 31, 2022

Re: implementation: Since the change is requested for rich text fields and blocks and both are/should be rendered with the richtext filter, that might be a good place for it. This would also avoid having to mess with Wagtails mechanism for storing and retrieving richtext.

@tbrlpld
Copy link
Collaborator

tbrlpld commented Jan 31, 2022

Thinking about this now, I think 1 is a fairly ambitious estimate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants