TrophyCustomer's Canvas is honored with a 2020 InterTech Technology Award! Learn more 

IGalleryButton Interface

A structure defining configuration of the Toolbox for launching the Asset Manager in a predefined mode. For more details, refer to The Asset Manager topic.

example

clientConfig.json

{
  "assetSources": {
    "Backgrounds": {
      "type": "PublicSource",
      "allowedExtensions": [ "jpg", "png" ]
    },
    "Instagram": {
      "type": "SocialNetworkSource",
      "network": "instagram",
      "apiKey": "88884444aaaa222288883333ffff6666"
    }
  },
  "widgets": {
    "AssetManager": {
      "tabs": [
        {
          "name": "Backgrounds",
          "assetSourceInstance": "Backgrounds"
        },
        {
          "name": "Instagram",
          "assetSourceInstance": "Instagram"
        }
      ]
    },
    "Toolbox": {
      "buttons": [
        {
          "translationKey": "Toolbox.IMAGE",
          "translationKeyTitle": "Toolbox.TITLE_ADD_IMAGE",
          "iconClass": "cc-icon-add-image",
          "buttons": [
            "Image",
            {
              "action": "Image",
              "translationKey": "Toolbox.INSTAGRAM",
              "translationKeyTitle": "Toolbox.INSTAGRAM",
              "iconClass": "cc-icon-add-instagram",
              "tabs": [ "Instagram" ]
            },
            {
              "action": "Image",
              "translationKey": "Toolbox.BACKGROUNDS",
              "translationKeyTitle": "Toolbox.BACKGROUNDS",
              "iconClass": "cc-icon-add-background",
              "tabs": [ "Backgrounds" ]
            }
          ]
        }
      ]
    }
  }
}

Properties

action

action: ButtonAction

The action that the button performs. You can define the Toolbox by using the actions alone.

Optional defaultTabName

defaultTabName: string

A tab to be displayed when the Asset Manager opens. By default, the first tab opens.

Optional iconClass

iconClass: string

The class of the button icon. You can find the complete list of available icon classes in \src\design-editor\Styles\ControlStyles\sp-icons.less.

Optional itemConfig

A structure containing the configuration of new design elements. For an example, you can refer to ILocationDefaultConfig or IBarcodeDefaultConfig.

Optional nameDialogEnabled

nameDialogEnabled: boolean

Enables a dialog box to type in the name of a new design element. The default value is false.

Optional tabs

tabs: string []

An array of available tab names in the Asset Manager. By default, all defined tabs are displayed.

Optional translationKey

translationKey: string

The translation key of the button caption. The corresponding string should be defined in the ~\Configuration\translations.json file.

Optional translationKeyTitle

translationKeyTitle: string

The translation key of the button tooltip. The corresponding string should be defined in the ~\Configuration\translations.json file.