Add anchor in getTypoLink
getTypoLink() doesn't allow you to pass an anchor parameter. So, in order to add an anchor to such a link you just have to add the anchor part to the id parameter:
$this->cObj->getTypoLink('Link Label', '123#myanchor');
'Link Label', '123#myanchor');
By the way, ever saw what the harmless function
class.tslib_content.php:typoLink()does? Have a look just for fun, it's a 300 liner! Feels like Typo3 has a damned considerable amount of workarounds for various special cases and requirements.
Leave a comment