Feature #14554
closed
XHTML compliance of img tags: should be border="0" for 1.0 transitional and removed (!) for 1.0 strict/1.1
Added by Simon Ihmig over 19 years ago.
Updated almost 18 years ago.
Description
Pages with images in it fail to validate against XHTML 1.0 strict because of the border="0" attribute in <img> tags, which is considered deprecated.
A config option to disable this output with all parts of TYPO3 that produce image code (cObj IMAGE, GMENU...) would be nice, maybe even an automatic solution when config.doctype=xhmtl_strict is set.
(issue imported from #M797)
Files
The border attribute has been removed from XHTML 1.1.
The border attribute has also been removed from XHTML 1.0 strict (not deprecated!)
the atached patch adds a new function to class.tslib_content.php which returns only a border attribute for images if the doctype is not xhtml_strict, xhtml_11 or xhtml_2 or if the config parameter 'disableImgBorderAttr' is not set.
example: config.disableImgBorderAttr=1
will disable border attributes in img tags even if the doctype is not in the list of doctypes which will automatically prevent the use of border attribs.
I'm preparing a patch that stores in $TSFE->xhtmlDoctype the actual doctype and in $TSFE->xhtmlVersion the version number (1.0, 1.1, ..).
I hope to get it into the core. So please wait a bit before anybode checks this patch in.
fixed in cvs:
- fix for bug 797: added a new function to class.tslib_content.php (getBorderAttr()) which returns only a border attribute for images if the doctype is not xhtml_strict, xhtml_11 or xhtml_2 or if the config parameter 'disableImgBorderAttr' is not set.
Setting 'disableImgBorderAttr' to '1' will disable border attributes in <img> tags even if the doctype is not in the list of doctypes above.
Also available in: Atom
PDF