Hey everyone,
I’m running into a frustrating issue with the DNN HTML editor. Every time I add custom HTML, CSS, or JavaScript to a module using the HTML editor, it keeps stripping out parts of my code or modifying it automatically when I go back in to edit.
For example: Inline styles and script tags get removed or rewritten. The editor sometimes reorders or reformats the markup. When I save and reopen, certain tags or attributes vanish completely. This makes it a pain to work with, especially when building custom layouts or embedding dynamic content. I’ve already tried: Switching between “Basic,” “Enhanced,” and “Advanced” modes in the HTML editor. Checking the HTML editor provider settings (CKEditor). Turning off “Replace Tokens” and enabling “Raw” mode when possible. Still, the problem persists. Has anyone found a reliable fix or workaround for this? Ideally, I’d like to disable all automatic filtering or sanitation so my code stays exactly as I entered it. Thanks in advance — any insight would be greatly appreciated!
— Joseph DNN Platformv. 10.01.02 (0) .Net Framework4.8.0 Server NameNebulaWeb
ChatGPT suggested; Editor Config field (top section, where you see “AllowedContent”), paste this: AllowedContent: true, ExtraAllowedContent: '*(*);*{*}', AutoParagraph: false, HtmlEncodeOutput: false, Entities: false, FillEmptyBlocks: false, BeautifyOnSave: false, StartupMode: 'source'
This may be becuase of the security feature in DNN. Here is my ChatGTP answer.
Question: In DNN CMS the security fo rthe ediotr strips JS from the input, how can i stop that in DNN10
Answer:
Ha Ha.... I can post it here becuse of security, :-) Ask the question to chatgpt.
Please read this first: https://dnncommunity.org/...-is-cleaning-my-HTML
Mitchel,
If adding CSS to a content section to format text is regarded as a security risk then what is the suggested alternative.
I use classes to format complex tables so they can be viewed on phones.
Regards
Hi Simon, Tables are usually styled in the CSS of the theme. Or in the module. Styling in the editor makes it part of the content and therefore inefficient. If for some reason you can not edit the code of the theme or module, you can always use the portal.css to overwrite other css. The HTML editor can be set quite specific. For instance to allow classes but not divs or js.
I have been trying to open the CKEditor Provider Settings space on a number of my DNN 10.2.0 sites. The Loading Options popup never goes away and I am unable to make the changes I need to make. Aware that site size may have an impact I have tried this on my smallest site (3 pages) and again unable to open this.
Have there been changes intended to stop any editing of these parameters?
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.