Jump to content

FrogCode - how to a link to a file I've uploaded in the editor


K.Ermit

Recommended Posts

FrogCode Editor's file store is separate to the deployed widgets, so you're making a widget and want to include files and images in the widget, you'll need to deploy your widget first.

This will package up the widgets and deposit them in the correct location, using the widget's UUID as parent folder.

So, a file added to the assets folder has the following path:

/app/package/widgets/'WIDGET UUID'/assets/

It's worth planning ahead with your widgets and not hard-coding in your Frog's web address.  This code can help with that:

var baseURL= Frog.Utilities.getBaseUrl();

this.element.append('<img src="'+baseURL+'/app/package/widgets/WIDGET UUID/assets/myimage.png">');

And if you want to refer to these images in your CSS or HTML, (after publishing once), you can use:

package/widgets/WIDGET UUID/assets/yourpic.png

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...