Reputation: 5122
I would like to create a "cleanup" extension that replaces various characters (quotes by guillemets) in all kinds of textfields in TYPO3.
I thought about extending <f:format.html>
or parseFunc
, but I don't know where to "plug in" so I get to replace output content easily before it's cached.
Any ideas, can you give me an example?
Upvotes: 2
Views: 397
Reputation: 10791
There also is another possibility which could replace any strings in the whole page - as it operates on the rendered page (and not only on single fields). You even can use regular expressions.
Look at my answer -> here
Upvotes: 2
Reputation: 114
If you don't mind regexing, try this:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['cleanUpQuotes'][] = \NAMESPACE\Your\Extension::class;
Insert it into ext_localconf.php and this part is done. The next step is the class itself:
public function cleanUpQuotes(TypoScriptFrontendController $parentObject)
{
$parentObject->content = DO_YOUR_THING_HERE
}
Upvotes: 2