Bug #60502
closedCSS Styled Content may render duplicate image attribute "title"
0%
Description
If you add an image to an Image-CE, you may add a title which is rendered as title attribute in the output.
If you additionally add a link to the image and add a title for that as well (I attached an example), the default Typoscript setting of "styles.content.imgtext.titleInLink = 1" will result in a duplicate title on the rendered link:
<a href="http://www.google.de" title="LINKTITLE" target="_blank" title="TITLE"><img src="/fileadmin/user_upload/dummy220.png" width="220" height="166" alt="ALT"></a>
Files
Updated by Riccardo De Contardi almost 10 years ago
Tested with TYPO3 6.2.9:
1) add an image CE
1.1) add Title attribute "IMAGETITLE" to the image
1.2) result:
<img width="600" height="450" title="IMAGETITLE" alt="" src="fileadmin/images/dummy.png">
=>OK
2) add a link to the image
2.1) result:
<a title="IMAGETITLE" href="index.php?id=3"> <img width="600" height="450" alt="" src="fileadmin/images/dummy.png"> </a>
=>THE TITLE ATTRIBUTE HAS BEEN MOVED TO THE ANCHOR!!
3) add a title attribute "LINKTITLE to the link
3.1) result:
<a title="LINKTITLE" href="index.php?id=3"> <img width="600" height="450" alt="" src="fileadmin/images/dummy.png"> </a>
=>NO DUPLICATED ATTRIBUTE, BUT THE LINK TITLE HAS OVERRIDDEN THE PREVIOUS ONE
Updated by Markus Klein almost 10 years ago
- Status changed from New to Closed
Thanks for testing this. That's the expected behaviour.
The bug is therefore only present in 6.1, which is not supported anymore.
Closing this issue.
Updated by Riccardo De Contardi almost 10 years ago
Thank you. I have not checked but IMHO if it is the expected behavior it should be described in some documentation, as (IMHO again) it is not much intuitive.
Thank you for your attention and best regards
Updated by Markus Klein almost 10 years ago
Well, no idea which documentation would be the right place. But what else would you suggest? Having a title on the link and the image would always hide the one from the image.
Updated by Riccardo De Contardi almost 10 years ago
you are right, the only thing I was thinking of is that if someone adds an attribute to a tag, he/she could find a bit "weird" to see it applied to another, that's all ;)