GrapeJS for existing CMS
Question
I am experimenting for a while with GrapeJS and already incorporated to our existing (custom) CMS, replacing tinyMCE. Since the two approaches are different, i would like to ask for your assistance how to handle the page saving after finishing editing the content. Right now, the approach is to extract contents of a standard defined area
<div class='editableHtmlArea' id='EDITABLE_CONTENT'> <?php /*** EDITABLE_CONTENT ***/ ?>..then post data in between and place it back (saving) to same file
What is your experience / approach, recommendation? Meanwhile, i tried 'editor.destroy()' before saving the data, but could not make it work .. so far :)
Answers (3)
@orionseye
editor.destroy() is not an option, since all the the html block declared with .init ..is gone as well.
you can call editor.getHtml and editor.getCss before destroying.
Cheers!
@pouyamiralayi Thank you for tip, i am considering to switch to remote storage, but for time being, the CMS was build to store (edited) content into flat file, the file someone currently edits. Each page has its own index.php, so GrapeJS is active once the 'edit' button is clicked. In that case, and after edit, the editor has to be destroyed, to save the template edits only. That's what i meant.
That is beau.ti.ful ! 3 lines and it works like a rocket.. get.Html even takes care to output valid html5 Sorry Pouya that i didn't think about that myself. Thanks so much
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3339
Question: How to add different aspect ratios to mobile devices in the device manager.
We are working on a cms system that uses grapes js. We came up with a condition where we couldn't add aspect ratio in the "mediaCondition"...
Issue #3091
[QUESTION] How to use grapesjs with static HTML
Sorry in advance for my English. I'm developing a CMS using Laravel and Vue.js. I want to use grapesjs for editing page content but with st...
Issue #2687
[Question] How to append style manager to custom panel
I would like to append the whole style manager module to a panel? I have been digging up the docs for the past 2 days and couldn't find a p...
Issue #2303
Updating toHTML of a new custom component
I would like to change how the toHTML output. I would like to modify the existing html output. I tried the "toHTML" property of componentit...
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.