grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Asset Manager replacement

Open ryandeba opened this issue 9 years ago • 3 comments

Is it possible to replace the asset manager with something completely different (such as CKFinder - https://ckeditor.com/ckeditor-4/ckfinder/)? Alternatively, would it be possible to launch the included asset manager outside the context of grapesjs?

ryandeba avatar Nov 08 '17 01:11 ryandeba

Well, never tried it before but I think you can achieve it just by replacing the current command

editor.Commands.add('open-assets', {
     run(editor) {
          ...
    }
})

This is how the command is called https://github.com/artf/grapesjs/blob/e921165a8d681b5d1056c816f88dd7719d4f61e0/src/dom_components/view/ComponentImageView.js#L68

the target is actually all what you need. When you select the element from a custom manager you just update the target with target.set('src', url)


UPDATE: new is API available for AssetManager customization https://grapesjs.com/docs/modules/Assets.html#customization

artf avatar Nov 08 '17 13:11 artf

Thanks @artf! I was able to get this working very quickly with your suggestion.

ryandeba avatar Nov 09 '17 01:11 ryandeba

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Dec 27 '19 16:12 lock[bot]