SitesSDK.getSiteProperty(propertyName, callback)

此函数从主机站点获取指定站点属性值。例如,提取主机站点正在使用的当前主题设计。

参数

名称 类型 说明

propertyName

字符串

站点属性的名称

callback

函数

用于读取属性值的回调函数

站点属性

属性名称 说明 设置 呈现

theme

当前主题设计的 URL

NA

用法

SitesSDK.getSiteProperty('theme',function(data){
                console.log(Theme data ' + JSON.stringify(data));
                // check if we got an url back
                if ( data.url && typeof data.url === 'string' ) {
                                if ( data.url !== '') {
                                          // theme is loaded so dynamically inject theme
                                          SitesSDK.Utils.addSiteThemeDesign(data.url);
                                }

                }
        });