[TYPO3-content-rendering] Valid anchor links

Andreas Schwarzkopf schwarzkopf.no.spam at artplan21.de
Mon Jun 27 11:44:00 CEST 2005


Hi Sacha,

the menu is not a problem, but for the RTE links you need a little code:

# all content element anchors get a prefix for the name and id attribute
tt_content.stdWrap.dataWrap = <a name="content{field:uid}" 
id="content{field:uid}"></a>|
# the section menu is adapted
tt_content.menu.20.3.renderObj.typolink.section.wrap = content|
# reference to a php function
includeLibs.xhtmlanchor = fileadmin/user_typolink.inc
tt_content.text.20.parseFunc.tags.link.typolink.parameter.postUserFunc = 
user_xhtmlAnchor

example for the fileadmin/user_typolink.inc:
<?php
function user_xhtmlAnchor($content,$conf) {
$uriparts = explode('#',$content);
if (isset($uriparts['1'])) {
   $content = $uriparts['0'].'#content'.$uriparts['1'];
}
return $content;
}
?>

I is not tested in a production environment, but it should work.

grtx

Andreas

Sacha Vorbeck schrieb:
> Hi,
> 
> I just finished another xhtml site and I`m a bit annoyed about the
> invalid anchor links that TYPO3 creates with tt_content.stdWrap.dataWrap.
> 
> I could make the links valid with
> tt_content.stdWrap.dataWrap = <a id="x{field:uid}"></a> |
> 
> But this also means that one would have to change the links in
> - section indexes (tt_content.menu.20...)
> - RTE link tool when linking directly to other content elements
> to prepend the x in front of the links.
> 
> Has anyone found out which method/class is responsible for those links?
> Is it one and the same function for both links or different ones?
> 
> I`d really like to get this solved.
> 



More information about the TYPO3-project-content-rendering mailing list