Envviroment:
Portal 8.5 Due to the lack of filtering in textbox.io customized components not working. Disabled the build in textbox.io and are using the integrated ear with modifications.
Need to use textbox.io filtering on saving the edited item(s) on a WCM page, for example
must have the style tag removed after save
Answer by wardciar (556) | May 04, 2017 at 08:25 AM
As a workaround,
Replace the following with the Tools.loadConfig under the styleSheetUrl declaration.
Tools.loadConfig(textboxioConfig).get(function(config) { WcmEditors.createEditor(wcmId, config, hiddenContentFieldName, directionality, styleSheetUrl); var editor = textboxio.getActiveEditor(); var stripInlineStyles = function (elements) { elements.forEach(function (el) { el.removeAttribute('style'); }); }; editor.filters.selector.addOutput('*', stripInlineStyles); });
Please note that for this to work, the user must use the design view or at least toggle away from the source/html view before saving
Answer by wardciar (556) | May 04, 2017 at 08:26 AM
Workaround:
Replace the following with the Tools.loadConfig under the styleSheetUrl declaration.
Tools.loadConfig(textboxioConfig).get(function(config) { WcmEditors.createEditor(wcmId, config, hiddenContentFieldName, directionality, styleSheetUrl); var editor = textboxio.getActiveEditor(); var stripInlineStyles = function (elements) { elements.forEach(function (el) { el.removeAttribute('style'); }); }; editor.filters.selector.addOutput('*', stripInlineStyles); });
Please note that for this to work, the user must use the design view or at least toggle away from the source/html view before saving