Issue #2534Opened January 25, 2020by andy-aware0 reactions

[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)

pouyamiralayiJanuary 27, 20200 reactions

@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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.