Hosting Custom Editors in Assets

Hello,

We want to quickly try out a new Custom Editor and the idea came up to host it in the Assets (we usually deploy applications to host them).

I came across a small comment from 5 years ago that says it is possible: [IMPLEMENTED] Custom Editor URL Administration - #2 by Sebastian

However there is no mention of this in the documentation for Custom Editors:

Is it possible but just not encouraged hence not being in the documentation?

All the examples use a single HTML file with inline JavaScript, but a lot of our custom editors are applications with multiple files that we target with a folder path, for example: https://<custom editor application URL/customeditors/angularclassiceditor/

If we do host in Assets is it simply a case of using a relative URL to a folder? Or is it that it just defaults to finding an HTML file so that above URL is the same as having:
https://<custom editor application URL/customeditors/angularclassiceditor/app.component.html?

Presumably relative paths within that HTML file in Assets would need to match the layout within Assets and so we could make use of that for shared libraries etc, so:

  • Assets
    • Custom Editors
      • Shared Libraries
      • Custom Editor A
      • Custom Editor B

Hope that all makes sense, turned into a general inquiry with a few small questions within!

The problem is that assets are referenced by IDs, not by file names. Therefore you cannot host a multi-file editor in the assets system.

1 Like

Ah right thanks for the quick response. We will go ahead with using Assets for our initial POC where we are keeping it in a single file but bear in mind we will likely need to host it if we want to take it forward and split it up into component files.

Oh except I forgot that we always need at least two files due to the editor-sdk.js, or else target https://cloud.squidex.io/scripts/editor-sdk.js however our Content Security Policy is blocking that so not quite as trivial as I was hoping!