Is any way to store the html id with its component when i click save button
@maryia-kabash IDs are created when required (added component-related style, component has scripts, etc.)
Read full answer below ↓Question
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

but after I saved and loaded into grapesjs it shows id="i3ibuf" in the below 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
Answers (3)
@maryia-kabash IDs are created when required (added component-related style, component has scripts, etc.)
You shouldn't load the HTML/CSS but the JSON data Read this please https://grapesjs.com/docs/modules/Storage.html
@artf JSON doesn't have ids as well (you can see it on GrapesJS Demo page). Is there any way to force saving ids?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1740
[Question]: CSS properties set on id elements not saved v0.14.50
When I try to put background color on a 1 column row element, it is inlined in the editor and not bind with id, it has unique id, and when...
Issue #3139
FEAT: Disable <table> being auto amended during save
I'm getting an issue, when saving a custom HTML component (just a table), grapes JS will modify it. before save after save. So I want to be...
Issue #3383
Is it possible to include the style in the html?
I'm currently using grapesjs to build email templates, however when I import HTML with the <style> tag already inside, before this is store...
Issue #3615
text in text component cannot update , cannot get final result from toHTML
it is text component, if select body, the text will correct save/apply/store in component toHTML method, if just updating text, but not lea...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.