Comments (8)
Hi!
Did you solve this? I need to fetch the image from another editorjs instance in another application with another domain and was wondering the same hehe
from directus-extension-editorjs-interface.
The reason I didn't set absolute URL to the output for the images is because the portability, and if you already access it through the API, then for sure you are aware with the domain, so you simply could put it.
Anyway, as this seems to be asked more often, I can think of adding a URI property (which will be quite ease) with absolute address, the only think I am not sure if it's good or not is to add field for a static token or not.
from directus-extension-editorjs-interface.
Wow fast response!
I think it could be interesting to add the ability to manually do it, but maybe not necessary if there is a way to handle it dynamically.
How is the url constructed today? I’m thinking, if it’s possible, to use the configuration invironment variable PUBLIC_URL (or maybe some other unknown to me better variable) and then append the path to assets and image.
In that way, it would be reachable from another application. But maybe that’s the way it’s constructed today?
from directus-extension-editorjs-interface.
Well, internally it uses the {baseUrl}/assets/{file.id}
(according the docs), where the baseUrl is PUBLIC_URL
env as you already mention.
And for token it uses the current user's token, which is not good idea to be added to the output because of possible leakage.
Anyway, it might be really good idea to add it to the final output as separate uri
or guid
property with an optional static token configuration field, I'll try to do it in next days.
from directus-extension-editorjs-interface.
Okey haha, lucky guess from my side.
just to be clear, when you say “add it to the final output as separate uri“ are you referring to adding the complete uri of the image, including the baseurl to a different key in the image meta-data structure? Because I’m thinking this: What if one of the editors is in a directus invironment, and the other editor is used in an angular project, wouldn’t it be better if the image url is always stored as the complete uri?
that way both editors would work without having to convert the image path.
but maybe I’m missing something here
from directus-extension-editorjs-interface.
Yes, there are couple of cases where this is not the most suitable, for example:
- domain is transferred/changed, then the content will point to the old one, so the stored JSON need a migration as well
- if the directus is used on dedicated domain (protected), but the assets are served through proxy, so the domains will mismatch
So in such cases, it might be more reliable to use fileId
or url
from directus-extension-editorjs-interface.
Ah yes. that is correct... didnt think of that
from directus-extension-editorjs-interface.
Related Issues (20)
- Can't select image from library HOT 4
- Textalign not persisted. HOT 4
- EditorJs Extension not visible inside Directus 9.5.0 HOT 4
- How do you add plugins to editorjs? HOT 8
- Deleting multiple blocks isn't synced
- New version of editorjs HOT 2
- Editor.js field within M2A field gives error HOT 1
- [Freelancer] medic appointement for direcuts v9. HOT 1
- EditorJS extension triggers a field update upon view HOT 3
- This content is blocked when use Youtube Embed HOT 1
- Alt Tag HOT 2
- Image block disappearing after saving HOT 4
- Bold text is not emitted HOT 5
- Add text color plugin HOT 1
- Pasting an image results in endless loading
- Editorjs instance does not update when interface value changes HOT 3
- Feature request: Add layout plugin
- Add tutorial explaining how to add own components or plugins HOT 2
- Any plan to update this extension? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directus-extension-editorjs-interface.