Search code examples
ckeditortypo3typoscripttsconfigtypo3-8.x

Make all pre-exisiting <b> and <i> to be <strong> and <em> after migration from rtehtmlarea in TYPO3 7.6 to rte_ckeditor in 8.7


The Goal

We need all <b> and <i> tags that come from one of TYPO3's rich text editor fields to be <strong> and <em>.

A Manual Solution (but we need an automated solution)

We can open up a content element that has the wrong tags and just click save and TYPO3 updates the tags. BUT we have maybe 100k content elements to sort through so we need a more automated solution.

The Problem

We have migrated a website from TYPO3 CMS 7.6 to 8.7. Along with that upgrade we are new using rte_ckeditor instead of rtehtmlarea. Any new content created by rte_ckeditor uses the correct tags, but anything that was originally created in rtehtmlarea before the migration continues to use <b> and <i> tags since it's saved in the database that way.


Soooooooo, how can we update our database to use only <strong> and <em> for all rich text editor fields ???


Solution

  • This is no technical solution but a general description which options exist to solve the problem with respect to the large amount of data

    For CKEditor I'd recommend an individual plugin that is replacing tags each time a content-element is opened for editing. Apart from that I'd recommend an output-parser that can be included in the page-setup or as extension of TYPO3 to rewrite undesired tags in favor of their desired replacements.

    Alternatively the whole database can be read by an individual PHP-script / TYPO3-extension to replace all tags once. This could be done on production-server with restricted amount of rewrites per minute / hour.
    Another option is to replace all tags in an database-export with any kind of tool or program and replace the old data then with the altered data in the database.