on ‎2022 Oct 06 3:45 PM
When I add custom html code into a paragraph component in SmartEdit, the default CKEditor setup will in most cases delete "unsafe" html and thus mess up my custom html code.
How can I add custom html code to my content pages via SmartEdit?
Request clarification before answering.
Hi Martin,
You can try this to disable ACF:
import { CommonModule } from '@angular/common';
...
@NgModule({
imports: [CommonModule, FormsModule, TranslateModule.forChild(), BadgeLabelModule],
providers: [
...
{
provide: RICH_TEXT_CONFIGURATION,
useValue: {
toolbar: 'full',
toolbar_full: [
...
],
...
allowedContent: true,
...
}
}
],
...
})
export class RichTextFieldModule {}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i just tried to set cms.components.allowUnsafeJavaScript to true, the content value in CMSParagraph component will kept the same as you input.
My experiment env is as follows:
Please note, if you edit the new created CMSParagraph component in SmartEdit, click the source button, you will find it becomes "<h1>hello</h1>", i think this is processed by SmartEdit editor to show just valid part, but the content value is not changed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your input.
I use SAP CC 2011.
For simple HTML examples it works fine, but still in some cases the editor completely messes up my code as soon as I switch from the source code view to WYSIWYG view or if I save and close the paragraph component.
If there's no other option I would have to wait for the 2205 update of my environment and try again.
If you want to add custom html code in paragraph component, please set the value of the cms.components.allowUnsafeJavaScript property to true in the local.properties, the default value for cms.components.allowUnsafeJavaScript is false
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick reply, but we already set this to true and it didn't help.
I found this information regarding the CKEditor setting: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_acf.html#allow-everything-disable-acf
But it seems the ACF of CKEditor cannot be disabled in SmartEdit 😕
Hi Martin,
As you set cms.components.allowUnsafeJavaScript to true, the html content in paragraph component should not be sanitized in the current implementation.
So this is strange as you said it doesn't work, would you please help to paste some custom html code which will be sanitized even though cms.components.allowUnsafeJavaScript is set to true?
Thanks
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.