Bug #88325

config.intTarget and extTarget

Added by Roman Büchler 2 months ago. Updated 14 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2019-05-09
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It seems that the default link target configuration doesn't work. The following configuration opens internal links in the same window and external links in a new window.

config {
  intTarget = _blank
  extTarget = _self
}

History

#1 Updated by DANIEL Rémy 2 months ago

Hello

How your links are generated ? ckeditor, viewhelper ?
What is the generated markup ?

#2 Updated by Roman Büchler 2 months ago

DANIEL Rémy wrote:

Hello

How your links are generated ? ckeditor, viewhelper ?
What is the generated markup ?

Hi Daniel, the ckeditor was used where the editor markup is as following

<p>DE Text mit <a href="t3://page?uid=1">internem Link</a> und <a href="http://delme.buechler.pro/">externem Link</a></p>

In the frontend it is

<p>DE Text mit <a href="/">internem Link</a> und <a href="http://delme.buechler.pro/" target="_blank">externem Link</a></p>

#3 Updated by DANIEL Rémy 2 months ago

I reproduce it on TYPO3 9.5.5.

#4 Updated by Georg Ringer about 1 month ago

for internal links this is easy to solve

--- a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ParseFunc.typoscript
+++ b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/Helper/ParseFunc.typoscript
@@ -18,7 +18,7 @@ lib.parseFunc {
                 parameter.data = parameters:href
                 title.data = parameters:title
                 ATagParams.data = parameters:allParams
-                target.data = parameters:target
+                target.override.data = parameters:target
                 extTarget = {$styles.content.links.extTarget}
                 extTarget.override.data = parameters:target
             }

for external links I don't have yet a solution for core.

however for fixing I would do

lib.parseFunc.tags.a.typolink.extTarget = _self
ib.parseFunc.tags.a.typolink.target = _blank

#5 Updated by Roman Büchler about 1 month ago

I tried the below TS (with 9.5.7) but couldn't observe any change.

lib.parseFunc {
  parameter.data = parameters:href
  title.data = parameters:title
  ATagParams.data = parameters:allParams
  target.data = parameters:target
  target.override.data = parameters:target
  extTarget = {$styles.content.links.extTarget}
  extTarget.override.data = parameters:target
}
lib.parseFunc.tags.a.typolink.extTarget = _self
lib.parseFunc.tags.a.typolink.target = _blank

#6 Updated by Emad Bitar 14 days ago

We have the same problem when creating links to pages using Data Processing and typolink is added to the target=_blank.

When calling the LegacyLinkBuilder class, the value of the target is extTarget instead of intTarget.

Unfortunately, there is no possibility to detect whether the given url is internal or external. The only way would be to parse the given URL. Also it's possible to assign another value as target when building the url. But the default is always to use extTarget.

$target = $target ?: $this->resolveTargetAttribute($conf, 'extTarget', true, $tsfe->extTarget);

Also available in: Atom PDF