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

How to Open "External Link" in New Window via CMS? #7

Closed
5 tasks done
wesleyboar opened this issue Jan 21, 2021 · 7 comments · Fixed by #178
Closed
5 tasks done

How to Open "External Link" in New Window via CMS? #7

wesleyboar opened this issue Jan 21, 2021 · 7 comments · Fixed by #178
Assignees
Labels
bug Something isn't working effort S Small effort task (~½ a week) — does not include review time priority ▼ Low priority research Investigation is required

Comments

@wesleyboar
Copy link
Member

wesleyboar commented Jan 21, 2021

In GitLab by @tacc-wbomar on Jan 21, 2020, 12:52

Deliverables

Tickets:

Solutions:

Goal

Any link to an external website should open in an external window. Especially:

Requirements

  1. Any link to external website should open in a new window when clicked*.
  2. This feature should not require configuration by CMS user.

* When clicked without modification key from user. (Cmd+ click on Mac browsers opens link in new window.)

Background

Django CMS does not manage this by default. Maybe the CMS user can do this per link. Or maybe not.

This should be a high priority ticket, because the original issue was created too long ago (GL-1), and it is the first request Hedda made fo me for CMS, and she has re-requested a few times.

Direction

See Direction in tickets listed in Deliverables.

Archived

CMS Menu & Article Listing

Use a Django filter "templatetag":

  1. (Python) Parse any known URL before rendering a link.
  2. (Python) Conditionally render target="_blank" attribute in link.
  3. (Template) Apply the filter to CMS menu markup.
  4. (Template) Apply the filter to article listing template/s (or a shared partial)

Text Plugin

Unsure. Ideas:

  • A. Find a way for CMS user to set link with target="_blank" and document this step as a requirement.
  • B. Author JavaScript to conditionally add target="_blank" after render for any links whose domain is different.
    • Gotcha: This is not possible for old CMS sites, because they do not use the external URL directly—they filter a redirect through a local slug. To remedy this, an array of such "redirect slugs/paths" may be provided to the script.
@wesleyboar wesleyboar added bug Something isn't working priority ━ Medium priority labels Jan 21, 2021
@wesleyboar wesleyboar self-assigned this Jan 21, 2021
@wesleyboar
Copy link
Member Author

wesleyboar commented Jan 21, 2021

In GitLab by @taoteg on Feb 12, 2020, 09:32

Need to install the cascade plugin to enable this capability.

https://djangocms-cascade.readthedocs.io/en/latest/link-plugin.html


Update (2020-04-05 by @tacc-wbomar): This link does not solve CMS navigation (i.e. header) link. And the other cases are already solved by existing plugins (Bootstrap4LinkPlugin, LinkPlugin)

@wesleyboar
Copy link
Member Author

In GitLab by @tacc-wbomar on Jan 20, 2021, 11:16

mentioned in commit 029deeb

@wesleyboar wesleyboar added priority ▲ High priority and removed priority ━ Medium priority labels Jan 21, 2021
@wesleyboar
Copy link
Member Author

The priority is now High, because this issue was created too long ago (GL-1), and is the first request Hedda made fo me for CMS, and has re-requested a few times.

@wesleyboar wesleyboar added the research Investigation is required label Jan 29, 2021
@wesleyboar wesleyboar added the tacc label Feb 2, 2021
@wesleyboar wesleyboar added the effort S Small effort task (~½ a week) — does not include review time label Feb 4, 2021
@wesleyboar wesleyboar changed the title Website Should Open "External Link" in New Window How to Open "External Link" in New Window Feb 4, 2021
@wesleyboar wesleyboar changed the title How to Open "External Link" in New Window How to Open "External Link" in New Window via CMS Feb 4, 2021
@wesleyboar wesleyboar added this to the Phase 1 Frontera milestone Feb 6, 2021
@wesleyboar wesleyboar removed the tacc label Feb 12, 2021
@wesleyboar wesleyboar changed the title How to Open "External Link" in New Window via CMS How to Open "External Link" in New Window via CMS? Mar 26, 2021
wesleyboar added a commit that referenced this issue Apr 6, 2021
@wesleyboar wesleyboar linked a pull request Apr 6, 2021 that will close this issue
@wesleyboar wesleyboar added paused Started but not actively in progress priority ▼ Low priority and removed priority ▲ High priority labels Apr 6, 2021
@wesleyboar
Copy link
Member Author

In #264, @tacc-wbomar:

  • learned how to (but did not) nest (Bootstrap4)LinkPlugin in a TACC plugin
  • learned how to (and did so) include LinkPlugin fields in a TACC plugin

@wesleyboar
Copy link
Member Author

wesleyboar commented Jul 13, 2021

The CMS menu solution does not work on Portal pages, like Public Data.

(This caveat was first documented in CEP Testing Session 7/13/21.)

@wesleyboar
Copy link
Member Author

wesleyboar commented Jul 23, 2021

Closing issue because research is half done and split among three tasks (#289, #291, #292) and has starter code in one PR (#178) for JavaScript implementation solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort S Small effort task (~½ a week) — does not include review time priority ▼ Low priority research Investigation is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant