Skip to content

Allow theme plugin to override settings and add menu options#5580

Merged
knolleary merged 2 commits intomasterfrom
5577-extend-theme-plugin-support
Mar 23, 2026
Merged

Allow theme plugin to override settings and add menu options#5580
knolleary merged 2 commits intomasterfrom
5577-extend-theme-plugin-support

Conversation

@knolleary
Copy link
Copy Markdown
Member

Closes #5577

This allows a theme plugin to override settings for certain properties. It also adds the existing menu options to what is supported in Theme Plugins.

Here is an example of how the plugin to set a custom favicon, page title etc.

A couple of notes:

  • the favicon/header.image settings must be full paths to the image relative to the root of the package.
  • for header.title/image/url - set to false to remove the title/image/link as desired
  • The example shows how to hide the Node-RED Help menu item and the version number menu item (that links to the help sidebar changelog).
module.exports = function (RED) {

    RED.plugins.registerPlugin('test-theme-plugin', {
        type: 'node-red-theme',
        // scripts: [],
        css: [
            'theme.css',
        ],
        page: {
            favicon: 'resources/favicon.png',
            title: 'Banana Theme'
        },
        header: {
            title: 'Flow Editor',
            image: 'resources/header-image.png',
            url: false,
        },
        menu: {
            'menu-item-help': false,
            'menu-item-node-red-version': false
        }

    })
}

For menu-item-help, the text/url of the menu item can be customised by setting it to an object with label and url properties:

        menu: {
            'menu-item-help': {
                label: 'Get Help',
                url: 'https://example.com'
            },
            'menu-item-node-red-version': false
        }

@knolleary knolleary merged commit 675f44e into master Mar 23, 2026
5 checks passed
@knolleary knolleary deleted the 5577-extend-theme-plugin-support branch March 23, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand support for Theme Plugin capabilities

1 participant