Editing Saved html editor.setComponents slider load issue
Question
I am working on a project where i integrated grapesJs for users to build there templates, save them in database and edit these saved templates.
I recently added slider plugin and now user can create templates but when edit i cause issue with javascript, I am using editor.setComponents when a user edit template and adding saved html in editor.setComponent('<saved html>') and css in editor.setStyle('<saved style>'),
Now when there is some kind of javascript in saved html like slider javascript and when comes the apostrophe (') in javascript it breaks the script and throw exception,
i can manulay pass these html and css in <div id="gjs"> but there body background css not works. What is batter solution for that??
editor.setComponents('{!! $template->html !!}'); editor.setStyle('{!! $template->css !!}'); editor.store();
i am using laravel and loading templates html and css like this
Answers (3)
i got a way to fix it, I directly passed the html and css content in <div>.
I got a new issue, when i pass the css in <div> to render it and html, i change the style and get it with editor.getCss(); it gets the old style that i passed into style tag in <div>
Related Questions and Answers
Continue research with similar issue discussions.
Issue #698
editor.getSelected().toHTML() is not consistent
Hi everyone, I created a new component type, 'html-block', which is a component in which you can add your html code. I added an 'Edit' butt...
Issue #1363
Problem trying to inject new HTML content in the Editor
Hi @artf, I'm now working on doing content in multi-languages inside the editor but I would like to know how can I save in the Dom HTML new...
Issue #1942
HTML conditional comments could not be loaded while we edit the template
While editing the template, conditional comment removed by auto rendering but works when we try to import and save
Issue #1715
Hello, I am new to your project, but I love it. I have a small issue with image attributes.
I added two new traits to the trait manager for images. Width and height. I added it as a plugin following your example. It totally works a...
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.