[Question] Swap out Image src
Question
Hi,
I've been doing so much reading on GrapesJs to find out how to build a component and assign it to a block. But after some time, I've figured using components isn't the right way to go.
I'm looking to swap out the image src and set a data-src to the image, however, I only want to do this on the save.
I have a storage manager setup, which passes data simply using the data['html'] into a text area.
editor.StorageManager.add('simple-storage', {
store(data, clb, clbErr) {
const html = data['gjs-html'];
}
});
Is there any route that Grapes can do this?
Thanks
Answers (1)
@awaredigital you can perform operations like text replacement for your specific case before the grapesjs try to store the components & html.
editor.on('storage:start:store', objToStore => {} )
Cheers!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #913
[Question] Using Style tag instead of css
Hi, I've been taking a look inside of the dom_components, but cant seem to figure out how to manually override the styling aspect. I need a...
Issue #2388
[Question] - How to import styles from <link> to be rendered when dragging block to canvas
My situation: I'm slowly importing some of my custom made UI components in ReactJS to GrapesJS. Now, I am able to render the component prop...
Issue #2865
[QUESTION] enable 'view components' button on panel by default
this button is currently off by default. so you have to turn it on every time, which is not obvious to everyone. how do you make it active...
Issue #2894
[Question]: How Do I Hide / Disable Dropzone in AM Modal
Hello, I've been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the A...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.