Issue #620πŸ’¬ AnsweredOpened December 7, 2017by xeux0 reactions

Remote Storage

Quick answerby DeathStapler

I had similar problems. Look at the issue I created. Issue #597. My issue related to the use of contentTypeJson: true, but you already have that in yours.

Read full answer below ↓

Question

I'm trying to use the remote storage but no success, with the resolved issues I manage to adjust eveything as it best, but editor do not render loaded HTML.

GrapesJS:

var editor = grapesjs.init({
	container : '#gjs',
	storageManager: {
		type: 'remote',
		autoload: true,
		stepsBeforeSave: 10,
		contentTypeJson: true,
		urlStore: 'domain.dev/store',
		urlLoad: 'domain.dev/load',
		params: {},
	},
	showDevices: false,
	plugins: ['gjs-blocks-basic'],
	pluginsOpts: {
		'gjs-blocks-basic': {/* ...options */}
	}
});

editor.on('storage:load', function(e) {
      console.log('Loaded ', e);
	  editor.render();
});

JSON: {"gjs-css":"", "gjs-html":"<div>HELLO</div>", "gjs-assets":"[]", "gjs-styles":"[]", "gjs-components":"[]"}

Load event: image

GrapesJS seems to be loading okay, I put the editor.render() after the init and also inside the load event to try out.

Answers (3)

DeathStaplerβ€’ December 7, 2017

I had similar problems. Look at the issue I created. Issue #597.

My issue related to the use of contentTypeJson: true, but you already have that in yours.

artfβ€’ December 8, 2017

GrapesJS seems to be loading okay, I put the editor.render() after the init and also inside the load event to try out.

You should use editor.render() only with autorender: 0, so remove it

xeuxβ€’ December 8, 2017

@DeathStapler thanks, I was able to load the urlLoad with that setting.

@artf still not able to render the editor, the console shows the loaded urlLoad but nothing on editor, also in the view source button.

I'm using the latest version.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.