-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't workingeffort SSmall effort task (~½ a week) — does not include review timeSmall effort task (~½ a week) — does not include review timepriority ▼Low priorityLow priorityresearchInvestigation is requiredInvestigation is required
Milestone
Description
In GitLab by @tacc-wbomar on Jan 21, 2020, 12:52
Deliverables
Tickets:
- Open "External Link" in New Window - Text Plugin #289
- Open "External Link" in New Window - TACC Plugin #291
- Open "External Link" in New Window - CMS Menu #292
- Open "External Link" in New Window - Plugins with Links #290
Solutions:
Goal
Any link to an external website should open in an external window. Especially:
- a header navigation link
- a link to an external news article, see How to Support External News Articles #112
- a link within CMS text content
Requirements
- Any link to external website should open in a new window when clicked*.
- 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":
- (Python) Parse any known URL before rendering a link.
- (Python) Conditionally render
target="_blank"attribute in link. - (Template) Apply the filter to CMS menu markup.
- (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.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingeffort SSmall effort task (~½ a week) — does not include review timeSmall effort task (~½ a week) — does not include review timepriority ▼Low priorityLow priorityresearchInvestigation is requiredInvestigation is required