Separate configuration for individual fields
Ticket on Forge: https://forge.typo3.org/issues/61531
Author: Stefan Neufeind
Description:
According to the docs it should be possible to apply separate settings for individual fields. But I've so far only been able to apply settings for RTE.default. Does this need additional code in tinymce4_rte?
http://docs.typo3.org/typo3cms/CoreApiReference/Rte/Transformations/Tsconfig/Index.html
Supposed to work imho: RTE.default { tinymceConfiguration = fileadmin/tinymce/tinymceConfiguration.js } RTE.config.tt_news.short { tinymceConfiguration = fileadmin/tinymce/tinymceConfigurationTtnewsShort.js }
Add
Comments:
David Gurk:
Hi, I have the same issue.
In my opinion it would be great if I can alter the configuration for different CTypes. Like in the third documentation example:
RTE.config.tt_content.bodytext.types.own_type.tinymceConfiguration = EXT:own_extension/Configuration/TinyMce/own_type.js
I played a bit within your code and tested a dirty four-liner in http://gitlab.sgalinski.de/typo3/tinymce4_rte/blob/master/Classes/Editors/RteBase.php#L84 to make this example work.
if (!self::$coreLoaded) {
self::$coreLoaded = TRUE;
$userOrPageProperties = BackendUtility::getModTSconfig($thePidValue, 'RTE');
// NEW begin
$rteContentTypeTinymceConfiguration = $userOrPageProperties['properties']['config.'][$table . '.'][$field . '.']['types.'][$row['CType'] . '.']['tinymceConfiguration'];
$tinymceConfiguration = $userOrPageProperties['properties']['default.']['tinymceConfiguration'];
if (isset($rteContentTypeTinymceConfiguration)) {
$tinymceConfiguration = $rteContentTypeTinymceConfiguration;
}
// NEW end
/** @var \tinyMCE $tinyMCE */
require_once(ExtensionManagementUtility::extPath('tinymce') . 'class.tinymce.php');
$tinyMCE = GeneralUtility::makeInstance('tinyMCE');
// Altered
$tinyMCE->loadConfiguration($tinymceConfiguration);
[...]
}
More special field configurations would be more difficult for sure.
Would be nice to see some feature like that in the near feature. If I can help, let me know.