Closed bhavinshahcin7 closed 4 years ago
Hello, According to the official docs of GrapesJS (https://grapesjs.com/docs/modules/Storage.html#basic-configuration). You can pass a storeManager configuration to the editor like below:
const storageManager = {
type: 'remote',
stepsBeforeSave: 3,
urlStore: 'http://endpoint/store-template/some-id-123',
urlLoad: 'http://endpoint/load-template/some-id-123',
// For custom parameters/headers on requests
params: { _some_token: '....' },
headers: { Authorization: 'Basic ...' },
};
You can pass your API URL to store the template using urlStore
and urlLoad
property.
Then, you initiate your editor and pass the storeManager configuration as a prop
Thank you for your reply. I am using grapesjs-react npm plugin. How can I use StoreManager in that ?
Thank You.
Hi, See my example below:
Sorry, you need to specify storage type as remote
:
Hello, I would like to save the HTML and CSS, both into database. How I can do that? Apart from that I am not able to drag and drop or upload an image into editor.
Any help would be great. Thank You.