Bug #88325
closedconfig.intTarget and extTarget
100%
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 }
Updated by Rémy DANIEL over 5 years ago
Hello
How your links are generated ? ckeditor, viewhelper ?
What is the generated markup ?
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>
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
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
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);
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.
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
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
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
Updated by Benni Mack about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7450b7829d03680fe6cac2d3aad2c53c30203a5e.
Updated by Susanne Moog almost 5 years ago
- Related to Bug #89994: Wrong target value for external links added
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed