Category structure

The following section will explain the structure of an action category.

Defining categories

A category in your plugin will be an action category in Touch Portal. Users can open that category and select actions from that to use in their buttons. A plugin can include as many categories as you want, but best practise is to use them as actual categories. Group actions for the same software integration in one category. This will allow the users have the best experience. Also keep in mind that if the users do not like the additions of your setup, they can just remove the plugins.

A category is an object with the following structure:

{
  "id":"plugin001",
  "name":"Spotify",
  "imagepath":"images/cat_spotify.png",
  "actions": [ ...actions... ],
  "events": [ ...events... ],
  "states": [ ...states... ],
}

This is the base of the plugin category. A category describes the collection of actions, events and states. We will cover the actions, events and states in other sections (see left menu). The data is as follows:

Attribute Type Mandatory From version Description
id Text yes 1.0 This is the id of the category.
name Text yes 1.0 This is the name of the category.
imagepath Text Optional 1.0 This is the absolute path to an icon for the category. You can should place this in your plugin folder and reference it. If you use %TP_PLUGIN_FOLDER% in the text here, it will be replaced with the path to the base plugin folder.

Image specs:
Format32bit PNG
Size24x24
ColorWhite icon with transparent background


Although colored icons are possible, they will be removed in the near future.
actions Collection Yes 1.0 This is the collection that holds all the actions. More on this in the actions section.
events Collection Yes 1.0 This is the collection that holds all the events. More on this in the events section.
states Collection Yes 1.0 This is the collection that holds all the states. More on this in the states section.

Specifying these object in will not be shown in Touch Portal unless there is at least one valid action or one valid event. Check the error.log for information when it does not work as you would expect.