From 70d08d3c5011b1fd9109dc8ef9b27abd764a9ad2 Mon Sep 17 00:00:00 2001 From: Nadezhda Tacheva Date: Fri, 19 Jul 2024 18:28:58 +0300 Subject: [PATCH 01/24] docs(editor): kb for adding icons --- knowledge-base/editor-add-icons.md | 89 ++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 knowledge-base/editor-add-icons.md diff --git a/knowledge-base/editor-add-icons.md b/knowledge-base/editor-add-icons.md new file mode 100644 index 000000000..f038b8fa2 --- /dev/null +++ b/knowledge-base/editor-add-icons.md @@ -0,0 +1,89 @@ +--- +title: Add icons in Editor +description: How to insert icons in Editor? +type: how-to +page_title: Add icons in Editor +slug: editor-kb-add-icons +position: +tags: editor +ticketid: +res_type: kb +--- + +## Environment + + + + + + + +
ProductEditor for Blazor
+ + +## Description + +I want to add icons... + +## Solution + +Modify the schema.... + +````CSHTML +@using Telerik.Blazor.Components.Editor + + + + + + + + + + +@code { + private string EditorValue { get; set; } = @"Here is an example icon in the Editor content "; + + // private List EditorTools { get; set; } = new List() { ViewHtml }; + +} +``` \ No newline at end of file From 1ed2b06f3a6c2b886dbd18e051dce718c95637bb Mon Sep 17 00:00:00 2001 From: Nadezhda Tacheva Date: Fri, 2 Aug 2024 16:37:46 +0300 Subject: [PATCH 02/24] chore(editor): add description and one more sample --- knowledge-base/editor-add-icons.md | 138 +++++++++++++++++++++++++---- 1 file changed, 123 insertions(+), 15 deletions(-) diff --git a/knowledge-base/editor-add-icons.md b/knowledge-base/editor-add-icons.md index f038b8fa2..aeeff90a2 100644 --- a/knowledge-base/editor-add-icons.md +++ b/knowledge-base/editor-add-icons.md @@ -1,11 +1,11 @@ --- -title: Add icons in Editor -description: How to insert icons in Editor? +title: Add Icons in Editor +description: How to insert icon tags in Editor? type: how-to -page_title: Add icons in Editor +page_title: Add Icons in Editor slug: editor-kb-add-icons position: -tags: editor +tags: editor, blazor, icon, schema, prosemirror ticketid: res_type: kb --- @@ -23,18 +23,55 @@ res_type: kb ## Description -I want to add icons... +I want to add custom icons in the Editor content. When adding an icon such as ``, the icon's HTML disappears upon saving. + +How can I add an `` element inside the Editor? ## Solution -Modify the schema.... +The built-in ProseMirror schema that the Editor uses does not support `` tag. To allow adding icons in the Editor content: + +1. [Modify the ProseMirror schema]({%slug editor-modify-default-schema%}) to include a node for the `` element. +2. Ensure the CSS classes for the icons are applied. The approach varies depending on the [edit mode of the Editor]({%slug editor-edit-modes-overview%}) + * [Iframe Edit Mode](#add-icons-in-iframe-edit-mode) + * [Div Edit Mode](#add-icons-in-div-edit-mode) + + +### Add icons in Iframe Edit Mode + +When the [EditMode of the Editor is set to `EditorEditMode.Iframe`]({%slug editor-edit-modes-iframe%}), the content area is an editable `