Issue Feature Closed

#14842Request for new config option prefixLocalAnchorLinks to gain XHTML compliance

Sacha Vorbeck 06/27/05, 12:17 updated 08/12/06, 14:22

Description

The definition of local anchors for content elements can be set via
tt_content.stdWrap.dataWrap

Standard output is:

XHTML compliant setting would be:
tt_content.stdWrap.dataWrap = |

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)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.