-
Notifications
You must be signed in to change notification settings - Fork 10
Single plugin mode
Single plugin mode (also known as “super web app” mode) is a version of the framework in which only one plugin is available. This plugin will function as a standalone web app within a framework instance adapted specifically for this use case.
This mode is activated by adding configuration to the region.json file.
A sample configuration looks like this:
"singlePluginMode": {
"active": true,
"pluginFolderName": "identify_point"
}
If active
is set to true
, the framework will attempt to launch single plugin mode when a user accesses the site.
pluginFolderName
should be set to the folder name of the plugin that you want to use in single plugin mode.
In single plugin mode, the app title is set using the same configuration property as in normal mode, titleMain.
"titleMain": {
"text": "Single plugin mode sample title",
"url": "http://www.nature.org"
},
A plugin can determine if single plugin mode is active by checking the singlePluginMode
app parameter available in a plugin's initialize
function. Below is sample code from the main.js
file of the Identify Point plugin.
...
initialize: function(frameworkParameters) {
declare.safeMixin(this, frameworkParameters);
if (frameworkParameters.app.singlePluginMode) {
$(this.container).append('<h2>Welcome to single plugin mode!</h2>');
}
...
Setting the contents of the help pane works much like providing custom content for the launchpad. Simply add a file at Views/Shared/SinglePluginModeHelp.cshtml
in your region repo. This file be used to populate the help pane in Single Plugin mode.