Project

General

Profile

Actions

Bug #88325

closed

config.intTarget and extTarget

Added by Roman Büchler over 5 years ago. Updated almost 5 years ago.

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

100%

Estimated time:
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
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89994: Wrong target value for external linksClosed2019-12-19

Actions
Actions #1

Updated by Rémy DANIEL over 5 years ago

Hello

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

Actions #2

Updated by Roman Büchler over 5 years 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>
Actions #3

Updated by Rémy DANIEL over 5 years ago

I reproduce it on TYPO3 9.5.5.

Actions #4

Updated by Georg Ringer over 5 years 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

Actions #5

Updated by Roman Büchler over 5 years 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
Actions #6

Updated by Emad Bitar over 5 years 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);
Actions #7

Updated by Benni Mack about 5 years ago

Roman, you should try to set
config.extTarget = {$styles.content.links.extTarget}
and use the constant to define the value, which makes your life much easier!

In addition, I created a patch to change this.

Actions #8

Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62184

Actions #9

Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62184

Actions #10

Updated by Gerrit Code Review about 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62281

Actions #11

Updated by Benni Mack about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Susanne Moog almost 5 years ago

  • Related to Bug #89994: Wrong target value for external links added
Actions #13

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF