diff --git a/news/4379.feature b/news/4379.feature new file mode 100644 index 0000000000..ecc114b1b9 --- /dev/null +++ b/news/4379.feature @@ -0,0 +1 @@ +Add open external link in a new tab config option. @robgietema \ No newline at end of file diff --git a/packages/volto-slate/src/editor/plugins/Link/render.jsx b/packages/volto-slate/src/editor/plugins/Link/render.jsx index 6b2c38bb2b..d5495e2879 100644 --- a/packages/volto-slate/src/editor/plugins/Link/render.jsx +++ b/packages/volto-slate/src/editor/plugins/Link/render.jsx @@ -1,11 +1,16 @@ import React from 'react'; import { UniversalLink } from '@plone/volto/components'; +import config from '@plone/volto/registry'; +import { isInternalURL } from '@plone/volto/helpers'; const ViewLink = ({ url, target, download, children }) => { + const { openExternalLinkInNewTab } = config.settings; return ( {children} diff --git a/src/config/index.js b/src/config/index.js index 7116f1b487..a4dee4f99d 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -111,6 +111,7 @@ let config = { downloadableObjects: ['File'], //list of content-types for which the direct download of the file will be carried out if the user is not authenticated viewableInBrowserObjects: [], //ex: ['File']. List of content-types for which the file will be displayed in browser if the user is not authenticated listingPreviewImageField: 'image', // deprecated from Volto 14 onwards + openExternalLinkInNewTab: false, notSupportedBrowsers: ['ie'], defaultPageSize: 25, isMultilingual: false,