Feature #14842
closedRequest for new config option prefixLocalAnchorLinks to gain XHTML compliance
0%
Description
The definition of local anchors for content elements can be set via
tt_content.stdWrap.dataWrap
Standard output is:
<a name="{field:uid}"></a>
XHTML compliant setting would be:
tt_content.stdWrap.dataWrap = <a name="content{field:uid}" id="content{field:uid}"></a>|
We need the prefix "content" because an id has to begin with a letter and not with a number.
But now we have 2 problems:
1. the links in tt_content.menu.20.3 section indexes to local anchors will have to be prepended with content
2. the links created with the RTE linktool will also have to be prepended
While 1. can be solved easily with:
tt_content.menu.20.3.renderObj.typolink.section.wrap = content|
2. can only be fixed with a user function (thanks to Andreas Schwarzkopf for this one):
includeLibs.xhtmlanchor = fileadmin/user_typolink.inc
tt_content.text.20.parseFunc.tags.link.typolink.parameter.postUserFunc = user_xhtmlAnchor
See example function below.
This is why I`d like to ask for a new config option that prefixes links to local anchors automatically with a given string.
config.prefixLocalAnchorLinks = content
That would help to create XHTML compliant sites without having to hack user functions.
// Function posted in content rendering newsgroup by A. Schwarzkopf
function user_xhtmlAnchor($content,$conf) {
$uriparts = explode('#',$content);
if (isset($uriparts['1'])) {
$content = $uriparts['0'].'#content'.$uriparts['1'];
}
return $content;
}
?>
keyword:accessibility
(issue imported from #M1243)
Files