melishev / strapi-plugin-react-editorjs

📝 Plugin for Strapi Headless CMS, hiding the standard WYSIWYG editor on Editor.js
https://www.npmjs.com/package/strapi-plugin-react-editorjs
MIT License
171 stars 80 forks source link

Return Placeholder from Strapi Plugin Placeholder #33

Closed gregghawes closed 2 years ago

gregghawes commented 2 years ago

Is there any way to return the placeholder field from the strapi-plugin-placholder plugin in embedded images?

gregghawes commented 2 years ago

Managed to do it myself

\admin\src\components\medialib\utils.js const newBlockData = { file: { url: entry.url.replace(window.location.origin, ""), mime: entry.mime, height: entry.height, width: entry.width, size: entry.size, alt: entry.alt, placeholder: entry.placeholder, formats: entry.formats, }, caption: "", withBorder: false, withBackground: false, stretched: false };

\admin\src\components\medialib\component.js const handleSelectAssets = files => { const formattedFiles = files.map(f => ({ alt: f.alternativeText || f.name, url: prefixFileUrlWithBackendUrl(f.url), width: f.width, height: f.height, size: f.size, mime: f.mime, placeholder: f.placeholder, formats: f.formats })); onChange(formattedFiles); };