K.Ermit Posted November 27, 2017 Share Posted November 27, 2017 Hi, I want to link an image (or file) to my widget, but I can't get the web address when I upload it. Link to comment Share on other sites More sharing options...
Graham Quince Posted November 27, 2017 Share Posted November 27, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now