@duncanc Lately I’ve been working on various templates including the one used for the phpList.org release announcements, and found the need to disable CKEditor every time I use the templates page, then re-enable it every time I edit the campaign content. That’s because my complex template HTML gets automatically reformatted and broken if CKEditor is enabled, but I still want to use it for basic text formatting within the campaign content.
It would be great if the Plugin had a setting which allowed enabling it only for campaigns but not for templates. What do you think?
1 Like
I think it would need to be a phplist configuration setting not the plugin because there are other editor plugins that must work in the same way. This is the code in template.php that invokes the editor
if ($GLOBALS['editorplugin']) {
echo $GLOBALS['plugins'][$GLOBALS['editorplugin']]->editor('template',
stripslashes($data['template'])).'</div>';
} else {
echo '<textarea name="template" id="template" cols="65" rows="20">';
echo stripslashes(htmlspecialchars($data['template']));
echo '</textarea>';
}
This could be changed to include a test of a configuration setting
if ($GLOBALS['editorplugin'] && getConfig('use_editor_template')) {
1 Like
That looks like a simple solution. In this case, the only changes that would be required would be the one you stated, plus the addition of a new default value, plus documentation, for use_editor_template
, correct?
I think that the configuration setting should be on the Settings page not a config.php setting. I’m not sure which file needs to be changed to add a new setting to, say, the Campaign Settings group.
Update - it’s the file defaultconfig.php that will need to be changed to add a new setting.