Bug #37710

config.extTarget = _blank does nothing

Added by Robert Breithuber about 9 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2012-06-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Since 4.7 target="_blank" disappeared from all external links, config.extTarget = _blank has no effect at all.

#1

Updated by Jigal van Hemert about 9 years ago

  • Status changed from New to Needs Feedback

Do you use XHTML Strict? XHTML Strict does not allow a target attribute in links. CSS styled content now follows those standards.

#2

Updated by Florian Seirer almost 9 years ago

Same problem here, and I use XHTML 1.0 Transitional.

#3

Updated by Robert Breithuber almost 9 years ago

Jigal van Hemert wrote:

Do you use XHTML Strict? XHTML Strict does not allow a target attribute in links. CSS styled content now follows those standards.

No.

config.doctype = xhtml_trans

Sourcecode shows:

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
#4

Updated by Florian Seirer almost 9 years ago

I reverted the changes back to css_styled_content 4.5.
\typo3\sysext\css_styled_content\static\setup.txt, starting line 68:

lib.parseFunc {
    makelinks = 1
    makelinks.http.keep = {$styles.content.links.keep}
#    makelinks.http.extTarget < lib.parseTarget
#    makelinks.http.extTarget =
#    makelinks.http.extTarget.override = {$styles.content.links.extTarget}
    makelinks.http.extTarget = {$styles.content.links.extTarget}
    makelinks.mailto.keep = path
    tags {
        link = TEXT
        link {
            current = 1
            typolink.parameter.data = parameters : allParams
#            typolink.extTarget < lib.parseTarget
#            typolink.extTarget =
#            typolink.extTarget.override = {$styles.content.links.extTarget}
            typolink.extTarget = {$styles.content.links.extTarget}

The line following the three # is from CSC 4.5.
That solved the problem, but I'm not sure if this was the right way to fix this.

#5

Updated by Robert Breithuber almost 9 years ago

You will have to use the default doctype (HTML 4.0), as XHTML does not allow link-targets at all, no matter if transitional or strict.
Thanks to Pascal Collins for pointing this out !

The Typo3 behavior is fully correct, following the standards - so this bug is invalid.

#6

Updated by Jigal van Hemert almost 9 years ago

Robert Lemke : See http://www.w3.org/TR/2002/REC-xhtml1-20020801/dtds.html#dtdentry_xhtml1-transitional.dtd_a the dtd for xhtml transitional specifies a target attribute for the anchor element.

#7

Updated by Robert Breithuber almost 9 years ago

Jigal van Hemert: oh, sorry, yes you are correct, target for anchors are indeed allowed for anchors in xhtml 1.0 transitional.

#8

Updated by Loek Hilgersom over 8 years ago

It may be correct that no target is added for XHTML strict, but there is also no target added for XHTML-transitional.
What is worse, the RTE still adds a property title="Opens external link in new window", which is really inconsistent behaviour, suggesting that the target-thing still works.

#9

Updated by Paul A. Auwehla about 8 years ago

In typo3 6.04 I can select RTE-links to open into _blank - target.
And I can give these targets a title.
And this is working, of course(!!) with XHTML.

Same in tt_news: Of course I can set external links and targets to _blank with the Link-Selector.
And of course this is working perfectly - in typo3 6.04 and XHTML.

If the w3.org decided to define and make links without target,
then they made simple total nonsense: Having targets in external links is
one of the most used features with links at all - and one of the most important features, too.

Please do not make squared wheels in typo3 even when the w3.org recommends this.
Leave the default targets-function as it is.

When in a very very very far future the browsers will not longer support this,
say when the paradies came to the internet - then it will be time to drop this feature.

Keep in mind: We are talking here about setting a default target.
Setting individual targets still works with typo3 and hopefully will work.

#10

Updated by Henrik Ziegenhain about 8 years ago

Same here with 6.0.x

Inserting a link in the RTE without explicitly choosing a _blank target does not print the target in Frontend.
The tag only gets rendered when i choose a target in link wizard.

The descripted issue only is present, when config.doctype = html_trans is set.

Setting doctype to html5 solves the problems with the missing default extTarget. Since XHTML Trans is still supported, this issue should be solved somehow.

#11

Updated by Alexander Opitz almost 8 years ago

  • Status changed from Needs Feedback to New
  • Target version deleted (4.7.2)
#12

Updated by Jigal van Hemert almost 8 years ago

@Paula : it's not about creating square wheels. Most (if not all) (semi-)government site has to comply with accessibility guidelines. Part of these guidelines is that the (x)html passes validation with the w3c validators.

I believe we need to enable the target attribute in more doctypes:

doctypes with target attribute

- xhtml basic : http://www.w3.org/2007/07/xhtml-basic-ref.html#attr_target
- xhtml 1.0 transitional : http://www.w3.org/TR/2002/REC-xhtml1-20020801/dtds.html#dtdentry_xhtml1-transitional.dtd_a
- xhtml 2.0 : http://www.w3.org/TR/xhtml2/mod-hyperAttributes.html#adef_hyperAttributes_target
- xhtml 1.0 frames : http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-frameset.dtd_a
- html5 : http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element

doctypes without target attribute

- xhtml 1.0 strict
- xhtml 1.1
- xhtml+rdfa 1.0

I'll prepare a patch for the 6.x range (4.7 is in security fix only mode).

#13

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22215

#14

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22224

#15

Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22225

#16

Updated by Jigal van Hemert almost 8 years ago

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

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22225

#18

Updated by Jigal van Hemert almost 8 years ago

  • Status changed from Under Review to Resolved
#19

Updated by Riccardo De Contardi almost 8 years ago

I suggested some time ago to replace the whole "_blank target" with something like:
http://accessify.com/features/tutorials/the-perfect-popup/ ;)

#20

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF