UPD: TinyMCE valid_elements

This commit is contained in:
Tony Air 2024-05-30 18:16:13 +02:00
parent 3db84a415e
commit dab4635488

View File

@ -1,5 +1,6 @@
<?php
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
use SilverStripe\Core\EnvironmentLoader;
$env = BASE_PATH . '/app/.env';
@ -10,3 +11,20 @@ $loader->loadFile($env);
'bcc_all_emails_to',//'cc_all_emails_to',
'test@example.com'
);*/
$cfg = TinyMCEConfig::get('cms');
$cfg->setOption('forced_root_block', 'p');
$cfg->setOption(
'valid_elements',
'strong/b,em/i,a[href|target=_blank],p/div,br,' .
'blockquote,' .
'img[class|src|alt|title|hspace|vspace|width|height|align|name|usemap|data*],' .
'iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],' .
'object[width|height|data|type],' .
'embed[src|type|pluginspage|width|height|autoplay],' .
'param[name|value],' .
'map[class|name|id],' .
'area[shape|coords|href|target|alt],' .
'ol[start|type]'
);