skip to Main Content

Here I integrate classic CK-Editor in View of C# file.I am trying to add new autocomplete plugin in classic editor.

    <div class="card-body areacls cardBox" contenteditable="true" id="@areaId" data-href="@item.Id" onclick="createEditor(@areaId)">
                            @Html.Raw(item.Description)
                        </div>
    <script>
    var editors = new Map();
    function createEditor(elementToReplace) {
    
                return ClassicEditor
                    .create(elementToReplace)
                    .then(editor => {
                        editors.set(elementToReplace, editor);
    
                    })
                    .catch(err => console.error(err.stack));
            }
    </script>

2

Answers


  1. Chosen as BEST ANSWER

    In classic Editor 5 version has some builtin plugins. you can't add new plugins in 5 version.If you want to use new plugin like mention you have to create your own custom editor from here https://ckeditor.com/ckeditor-5/online-builder/ or you can change the predefined builds like Classic,Inline,Balloon,Balloon-block,Document,Multi-root,Superbuild.


  2. Try to useF12 to see if any error message in your console.

    I guess you miss the <script>,refer to [ckeditor.com] 🙁https://cdn.ckeditor.com/)

    To start using CKEditor 5 Builds on your website, add a single
    <script> tag to your HTML page:

    add below code:

    <script src="https://cdn.ckeditor.com/ckeditor5/37.0.1/classic/ckeditor.js"></script>
    

    result:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search