question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Load assets from remote storage

See original GitHub issue

Hi, at first - thank you for this editor, its great and I will surely use it in many projects! 😃

I have a problem with loading assets on init.

My storage configuration is: storageManager: { type: 'remote', urlStore: '{!! url('admin/marketing/subscription/campaigns/store', [$model->id]) !!}', urlLoad: '{!! url('admin/marketing/subscription/campaigns/load', [$model->id]) !!}', contentTypeJson: true }

My load function in PHP:

foreach((array)$entity->assets as $asset) { $assets[] = ['src' => File::find($asset)->getFullUrl(), 'type' => 'image']; } return response()->json(['gjs-html' => $entity->content, 'gjs-css' => $entity->styles, 'gjs-assets' => $assets]);

And Im returning this JSON from backend:

{"gjs-html":"SOME HTML", "gjs-css":"SOME CSS", "gjs-assets":[{"src":"http:\/\/edito.localhost\/storage\/image\/cms_subscription_campaigns\/2017\/6\/27\/4db7ee187e2798fe7828c88cc79e70af\/IMG_9489m.jpg","type":"image"}]}

In result, I have all HTML and CSS loaded in editor, but images (assets) component is still empty. How to return data from load function in backend to fill assets component with my files?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Chronis77commented, Jul 5, 2017

Thanks, any quick fix i can plug just for temporary testing purposes?

1reaction
artfcommented, Jul 5, 2017

ah ok the loader, in asset manager, uses JSON.parse on any value 😁 will fix it for the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote Assets - Overview - Docs - Snap Inc.
Remote Assets offers developers a way to store assets within Lens Cloud to dynamically load their created content into Lenses at runtime.
Read more >
How to load assets from remote location (local servers)
Not sure if this has been answered before, but I'm trying to load assets (360 videos) from another source, i want to be...
Read more >
Remote content distribution | Addressables | 1.19.19
To set up a group so that the assets in it can be hosted remotely, set the Build & Load Paths using the...
Read more >
Time to update your addressables build.
Update Assets Remotely! Save yourself headaches and time, bypassing Building [Unity3d Addressables]. Project & Code · Want more help? Need ...
Read more >
Android: How to reference asset images from a remotely ...
OK, thanks to mufumbo's answer I now found a working hack to mix local assets in remotely loaded HTML pages. Pages loaded using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found