Project

General

Profile

Actions

Feature #14842

closed

Request for new config option prefixLocalAnchorLinks to gain XHTML compliance

Added by Sacha Vorbeck almost 19 years ago. Updated almost 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Frontend
Target version:
-
Start date:
2005-06-27
Due date:
% Done:

0%

Estimated time:
PHP Version:
4
Tags:
Complexity:
Sprint Focus:

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

bug_1243_part1.patch (1.79 KB) bug_1243_part1.patch Administrator Admin, 2005-11-11 15:13
bug_1243_part2.patch (94.5 KB) bug_1243_part2.patch Administrator Admin, 2005-11-11 15:13

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #14948: FE anchor references not XHTMLClosed2005-08-28

Actions
Related to TYPO3 Core - Bug #15450: Local anchors are prepended with an "c" character, and that breaks functionality.Closed2006-01-23

Actions
Actions

Also available in: Atom PDF