Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure local plugin when using ckeditor from cdn #60

Closed
jmalatia opened this issue Sep 9, 2020 · 2 comments
Closed

Unable to configure local plugin when using ckeditor from cdn #60

jmalatia opened this issue Sep 9, 2020 · 2 comments
Labels
resolution:by-design Described behavior is a part of feature design and is not expected to be changed.

Comments

@jmalatia
Copy link

jmalatia commented Sep 9, 2020

There is no way we can see to configure the path for a local custom plugin when using ckeditor from cdn.

Without vue, the normal process would be:

<script src="https://cdn.ckeditor.com/4.12.1/full/ckeditor.js"></script>
<script>
    CKEDITOR.plugins.addExternal('divarea', '/path-to-local-plugin/plugins/divarea/', 'plugin.js');
</script>
<script>
    CKEDITOR.replace("HtmlContent", {
        customConfig: 'ckEditorLocalPathToConfig/config.js',
    });
</script>

Then in config.js:

CKEDITOR.editorConfig = function( config ) {
    config.extraPlugins = 'divarea';
}

Seems like ckeditor4-vue needs something like a pluginAddExternal prop added to the component and then invoked in it's code before it calls replace?

@jacekbogdanski jacekbogdanski self-assigned this Sep 11, 2020
@jacekbogdanski
Copy link
Member

jacekbogdanski commented Sep 11, 2020

@jmalatia CKEditor 4 Vue integration won't load CKEDITOR namespace if you do it yourself. That means that you could still use CDN script externally to have access to the CKEDITOR object, so you can add an external plugin before the editor instance will be initialized. Please, take a look at https://codepen.io/jacekbogdanski/pen/vYGjLxe where I'm using standard editor preset without editorplaceholder plugin, but I can still load it using CKEDITOR.plugins.addExternal.

However, I think it's a good idea to introduce some method which would allow us to access CKEDITOR namespace before initializing editors for use cases like the above. I will create a separate ticket for that (#61).

@jacekbogdanski jacekbogdanski added the resolution:by-design Described behavior is a part of feature design and is not expected to be changed. label Sep 11, 2020
@jacekbogdanski jacekbogdanski removed their assignment Sep 11, 2020
@jmalatia
Copy link
Author

@jacekbogdanski We are using this in a vue SPA with single file components and ckeditor.component so the codepen will not work for us. But the new ticket #61 you opened is exactly what we need. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:by-design Described behavior is a part of feature design and is not expected to be changed.
Projects
None yet
Development

No branches or pull requests

2 participants