Insert HTML+CSS inline into [help wanted)
Hi @svalenciano81 Did you try this? var cmdGetCode = cmdm.get('gjs-get-inlined-html');
Read full answer below βQuestion
I have the nice ckeditor 4 editor built into grapesjs with this components: grapesjs: 0.15.8 grapesjs-preset-newsletter: 0.2.20 ckeditor.js: 4 grapesjs-plugin-ckeditor - 0.0.9 My project generates newsletters (HTML + CSS) to be storage in database. This newsletter it can be edited and save it again as many times as you want. When the newsletter is finished editing, it can be sent by Gmail. My problem is this:User generate newsletter (html + css) and is save it as "html + css" inline getted with; var htmlWithCss = editor.runCommand('gjs-get-inlined-html');This is saved in database.For edit the...
Answers (3)
Hi @svalenciano81 Did you try this?
var cmdGetCode = cmdm.get('gjs-get-inlined-html');
Hi @Abhisheknanda1344463 I need the reverse process. I have the code inline and I need to separate it into components and styles separate.
To load back your templates you shouldn't use the HTML/CSS, you have to store and load the JSON https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2644
GrapesJS load html/css from Database
Hi there, We are using grapesjs in our Angular app. We have managed to create and save the grapesjs html/css in our database. One of the th...
Issue #2231
Css issue in getCss
FYI: am using 0.15.3 i have loaded a html component into editor and saved for multiple times i noticed that how many times we load /edit an...
Issue #1310
Grape JS works for newsletter
We are testing to use the editor and we want to know if the grape js editor works for content newsletters, we were doing tests but CSS styl...
Issue #6606
Editor takes a long time to load (sometimes over 1 minute)
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Firefox Reproducible demo link https://gra...
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 βRelated tutorials
In-depth guides on the same topic.
Tutorial
How We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
Tutorial
Ship to Production Faster: Whatβs New in GrapesJS Shadcn
Supercharge your page builder! GrapesJS Shadcn adds live drag previews, rich text / commands, dynamic data, and canvas presets to ship to prod faster.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins β TinyMCE Inline Text Editor and Placeholder.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.