A plugin is a package written by a programmer that can extend the capability of Saltcorn with new functionality that you could not otherwise create through the Saltcorn user interface. Plugins can provide the following functionality extensions:
- Types. Plugins can create new types that can be used to define fields with new kinds of data. For instance, the markdown plugin gives you a new type, markdown, which can be used to create formatted text as one of your fields.
- View templates. View templates allow you to create new kinds of views.
- Themes: the theme determines the look and feel of the application.
- File views: a way of showing the contents of a file to the user
- Field views: different ways of showing or editing types inside views
A plugin can provide any mixture of the above kinds of extensions and more than one of each: for instance, a plugin can define three types, two view templates and one theme.
Note that the theme that is applied is the most recently installed plug-in that provides a theme.
Install from store
To install the plugin from the store, go to the Plugins menu (under Settings). This page shows the plugins that can be installed from the store. To install one of these plug-ins, simply press the install button. The plugin will be downloaded and installed, and will appear again in the list of plug-ins, this time with a small label that says "installed". From there it can be removed again by pressing the "Remove" button.
You can also install a plugin that is not in the store. For instance, if you are a plugin developer, you will need to initially run your plugin from your local drive. You can also install a plugin from GitHub or NPM, for instance if you have a private plugin that you do not want to put on the store.
To start manually installing a plug-in, click the button with three dots to the right of the switches that let you show different plug-in types at the top of the plug-in store. Select "Add another plugin" from the menu that appears.
You must then enter:
- The name of the plug-in. This should be the name of the node package, as listed in package.json.
- The source. This is a choice between GitHub, npm (a package that is uploaded to the NPM package database) or local (a package on your local drive).
- Location. This depends on the source. If the source is
- npm: enter the package name as the location
- github: enter the repository as
- local: give the full path to your package
- Version (self hosted only). You can enter the version here. This will be ignored unless the source is npm.