SitesSDK.setProperty('componentAssets', [assets])

此函數可更新自訂元件所儲存的網站資產清單。

參數

名稱 類型 描述

componentAssets

字串

建立元件資產清單。

assets

JSON 物件

傳回所選的資產清單。

引數

特性名稱 描述

filetypes

支援的檔案類型清單

multiSelect

選取單一或多個檔案。

用法

// get/set list of assets
SitesSDK.getProperty('componentAssets', callback);
SitesSDK.setProperty('componentAssets', [assets]);  
  
// invoking list creator
// after calling this, the developer needs to call setProperty against
// 'componentAssets' to persist all currently used assets
//
// args:
//  fileTypes - list of supported file types
//  multiSelect - single or multiple file select
// 
// returns a list of selected assets. If user cancels out of the picker, 
// the callback is never called
SitesSDK.filePicker({options}, callback);
  
//
// example 'componentAssets' JSON returned:
//
'componentAssets': [{ 
   'name': <nameOfAssetInContentFolder>,    // this is used to uniquely and persistently identify the asset.  It is typically prefixed by the ¿originalName¿ followed by a 16 digit string
   'originalName': <originalName>,          // name of the asset as selected from DOCS
   'description': <description>,            // description/other attributes that are available from DOCS
   'url': <fully qualified url to the asset>
}]