Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Single plugin mode

Arianna Robbins edited this page Feb 8, 2018 · 7 revisions

Overview

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.

image

Activating single plugin mode

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.

Setting the app title

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"
},

Detecting single plugin mode within a plugin

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>');
    }

    ...

Configuring the help pane contents

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.