Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytlwu committed Apr 9, 2024
1 parent f4d1e10 commit e54516a
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions docs/API/core/widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ Fliplet.API.request('v1/widget-instances/123').then(function (response) {
})
```

### Get asset path for widget instance

Depending on whether the app is rendered as a web app or on a native device, you can get the asset path for a widget instance:

```js
// Returns CDN or local file path based on platform
Fliplet.Widget.getAsset(123, 'img/placeholder.jpg')
```

### Find widgets

```js
Expand Down Expand Up @@ -152,12 +143,14 @@ Fliplet.Studio.emit('widget-save-complete', {

### Get the URL to an asset from the relative path of a widget

Depending on whether the app is rendered as a web app or on a native device, you can get the asset path for a widget instance:

```js
// the first parameter is the widget id as usual
var url = Fliplet.Widget.getAsset(123, 'img/icon.png');
// Returns CDN or local file path based on platform
var url = Fliplet.Widget.getAsset(123, 'img/placeholder.jpg');

// on the interface, you can skip the id (same as getData and getUUID)
var url = Fliplet.Widget.getAsset('img/icon.png');
// When used on the configuration interface, you can skip the ID (same as getData and getUUID)
var url = Fliplet.Widget.getAsset('img/placeholder.jpg');
```

### Get a widget instance unique identifier
Expand Down

0 comments on commit e54516a

Please sign in to comment.