[QUESTIONS] is any way to store the html id with its component when i click save button
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 #2861
[HELP] Get css of selected component and its children
Hi, i'm trying to implement possibility to save elements as custom blocks. How can i get css of component and its children? I can recursive...
Issue #889
[QUESTIONS]: Destroy Editor
is there way to destroy editor, I need to add button on page if user click, open page in editor and on save close editor and remove any ref...
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.