<?php
namespace MIN\MinSitecore\Hooks;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
class CkeditorConfigHook {
/**
* Adjusts CKEditor configuration based on TYPO3 version
*
* @param array $parameters
* @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer
*/
public function process(array $parameters, \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer) {
$typo3Version = VersionNumberUtility::getNumericTypo3Version();
if (version_compare($typo3Version, '11.5', '<')) {
// Load CKEditor 4 configuration
$this->loadCkeditor4Config($pageRenderer);
} else {
// Load CKEditor 5 configuration
$this->loadCkeditor5Config($pageRenderer);
}
}
protected function loadCkeditor4Config($pageRenderer) {
// Implement CKEditor 4 specific configuration
}
protected function loadCkeditor5Config($pageRenderer) {
// Implement CKEditor 5 specific configuration
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter