i want to use the userFunc to rewrite a link when it as the class "button". So my Config: Setup TS:
includeLibs.userFunc= fileadmin/userfunc/typolink.php
tt_content.text.20.parseFunc.tags.link.postUserFunc = user_userFunc->addButton
tt_content.text.20.parseFunc.tags.link.postUserFunc.class = button
tt_content.text.20.parseFunc.tags.link.postUserFunc.ATagTitle.field = title
and in my typolink file:
<?php
class user_userFunc{
function addButton($content,$conf) {
$class = $conf['class'];
if (preg_match('/class\="(.*'. $class .'.*)"/i', $content, $res)) {
$content = preg_replace('@>(.*)</a>@i', '><div class="btn-group"><div class="btn-txt">$1</div><div class="btn-icon"><span style="width: 17px; height:17px;" class="wbt-icon wbt-weiter"></span></div></div></a>', $content);
}
#$content = "TEST TEST TEST";
return $content;
}
}
So i added Links with the button class. As i can see in the frontend they have the button class two. But my Methods are not starting.
Hope some of you have an idea how to fix it.
Typo3 version 6.2.14
includeLibs
setting has been removed in TYPO3 7.4, maybe that is the cause? - Jost