Custom Icon Library in 8.3

From the documentation: This does not appear to be the proper location for a custom icon library in 8.3. Did a search for material.svg and it is not found. I'm assuming this is still allowed. What folder should a custom library go into now?

Use a Custom Icon Repository

The materials icon repository is a great source for icons, but if you have a custom library of icons, you can set it up to be accessible by Ignition. All icon repositories are stored as SVG files within the Gateway's Installation Directory. A typical path to an icon file will look like:

  • Windows
  • MacOS
  • Linux
C:\Program Files\Inductive Automation\Ignition\data\modules\com.inductiveautomation.perspective\icons\<repository name>.svg

You can create custom libraries by adding your own SVG file at this path. The properties inside the file are defined using XML, which

1 Like

Okay, here's the current steps.

  1. Navigate to your install directory, and in the /data/config/resources/core/ folder, create a new folder com.inductiveautomation.perspective/ (if it doesn't already exist).

  2. Within that folder create an icons/ folder.

  3. Within that folder create a <repository name>/ folder.

  4. Within that folder, create:

    • The spritesheet of your SVG, at whatever arbitrary filename you want, e.g. icons.svg.
    • A config.json file that contains a single entry, svgFileName, that contains the same name (icons.svg or whatever else you chose)
      {
       "svgFileName": "icons.svg"
      }
      
    • A resource.json file that references both config.json and your custom icons SVG:
      {
          "scope": "A",
          "version": 1,
          "restricted": false,
          "overridable": true,
          "files": [
              "config.json",
              "icons.svg"
          ],
          "attributes": {
          }
      }
      
  5. Restart the gateway (or POST the /data/api/v1/scan/config endpoint) to pick up the changed resource.

3 Likes

As an aside, I'm not sure if there's a rationale I'm not aware of for the indirection of the config.json resource. I'm going to make a case to drop it for final release, so you would just have a resource.json file pointing to the svg file (by whatever arbitrary name). There may be a complicated upgrade related reason we had to do things this way, though.

That worked for me. Thanks.

Perfect. Thank you sir!