Hello @artf , i am facing an issue for image not rendering inside the asset manager, can you please tell me if i am doing anything wrong
Using the latest version grapesjs-preset-newsletter
Here is the code of asset manager and storage manager
storageManager: {
id: "gjs-", // Prefix identifier that will be used on parameters
type: "local", // Type of the storage
autosave: true, // Store data automatically
autoload: true, // Autoload stored data on init
stepsBeforeSave: 1, // If autosave enabled, indicates how many changes are necessary before store method is triggered
},
assetManager: {
autoAdd: 1,
assets: [],
upload: 'https://staging.teks.co.in/udayan/newsletter-new/storage.php',
uploadName: 'fileToUpload',
}
Here is the response
{"data":[{"type":"image","src":"https:\/\/staging.teks.co.in\/udayan\/newsletter-new\/images\/01-RDH_Human-brain_english-
750x900.png","width":750,"height":900}]}
Hello @artf , i am facing an issue for image not rendering inside the asset manager, can you please tell me if i am doing anything wrong
Using the latest version grapesjs-preset-newsletter Here is the code of asset manager and storage manager storageManager: { id: "gjs-", // Prefix identifier that will be used on parameters type: "local", // Type of the storage autosave: true, // Store data automatically autoload: true, // Autoload stored data on init stepsBeforeSave: 1, // If autosave enabled, indicates how many changes are necessary before store method is triggered }, assetManager: { autoAdd: 1, assets: [], upload: 'https://staging.teks.co.in/udayan/newsletter-new/storage.php', uploadName: 'fileToUpload', }
Inside script $turl = addslashes('https://staging.teks.co.in/udayan/newsletter-new/'.$target_file); $imageinsertArr = array( 'type'=> 'image', 'src'=> $turl, 'width'=> $width, 'height' => $height,
); array_push($resultArray,$imageinsertArr); $response = array( 'data' => $resultArray ); // echo json_encode( $response,JSON_UNESCAPED_SLASHES); echo json_encode( $response);
Here is the response {"data":[{"type":"image","src":"https:\/\/staging.teks.co.in\/udayan\/newsletter-new\/images\/01-RDH_Human-brain_english- 750x900.png","width":750,"height":900}]}