TACC/Core-CMS

Open "External Link" in New Window - CMS Menu

wesleyboar opened this issue · 1 comments

Status

Migrated to JIRA FP-1451.

Archived

Alternative

  • #178
    (as of 2021-07-22) Caveat: This does not work on Portal pages.

Goal

Any link within the CMS menu to an external website should open in an external window/tab.

Requirements

  1. Any CMS menu 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.)

Direction

via JavaScript

  • Put the JavaScript from #178 into the shared header code.

via Django templating

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)

Migrated to JIRA FP-1451.