[Question]: Load html content from a file dynamically
Question
Hi, I need to load content from a html file from server onto editor after or while initializing editor. How this can be implemented? HTML will have regular html content i.e HTML tag, script tags, css links and body content which needs to be loaded into editor.
StoreManager api documentation is limited and looks like default load looks for a specific JSON structure with separate html, css as data.
Thanks in advance.
Answers (3)
StoreManager api documentation is limited and looks like default load looks for a specific JSON structure with separate html, css as data.
Because this is the right way of loading template data, but if this is the first time you load a template you can place all the HTML inside html key instead of components (by leaving it empty) and the editor will use it
StoreManager api documentation is limited and looks like default load looks for a specific JSON structure with separate html, css as data.
Because this is the right way of loading template data, but if this is the first time you load a template you can place all the HTML inside
htmlkey instead ofcomponents(by leaving it empty) and the editor will use it
can you give me simple example with basic html in json reponse ?
@suresh5 can you please avoid making requests on closed issues...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #843
[QUESTION] - CssComposer - removes unused classes
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import,...
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Issue #1788
[QUESTION] How to dynamically add assets from the server after editor initialization?
Hi! Thanks for the work you've done building this cool library! I am using latest angular and stuck with issue when I open image library in...
Issue #1700
Grapesjs-react
how to load an html file while starting the GrapesJs-react- editor I tried in this way but it is not working, editor.StorageManager.add('lo...
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.