grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

[QUESTIONS] is any way to store the html id with its component when i click save button

Open Ramkumar-Murugesan opened this issue 7 years ago • 3 comments

Hi. I know the grapesjs will generate the unique id for each HTML. when I store that HTML and CSS. the HTML id is not stored in my database. so when i reloaded my saved data into grapesjs it shows new unique id for each HTML element.

before saving the HTML. we have id="i63ss1" as u can see in the below image

image

but after I saved and loaded into grapesjs it shows id="i3ibuf" in the below image

image

I want to load the same HTML id. is there any way to store the HTML id along with its HTML element

Thanks in Advance

Ramkumar-Murugesan avatar May 01 '19 06:05 Ramkumar-Murugesan

You shouldn't load the HTML/CSS but the JSON data Read this please https://grapesjs.com/docs/modules/Storage.html

artf avatar May 01 '19 11:05 artf

@artf JSON doesn't have ids as well (you can see it on GrapesJS Demo page). Is there any way to force saving ids?

maryia-kabash avatar Jan 23 '20 11:01 maryia-kabash

@maryia-kabash IDs are created when required (added component-related style, component has scripts, etc.)

artf avatar Jan 23 '20 21:01 artf