JS Editor
JS Editor result

This module allows administrators to customize a theme's JS through the browser, using a rich text editor with syntax highlighting.

On the settings page of each theme it will be displayed a textarea where the admin can type custom Javascript code.
The feature can be enabled to multiple themes on the same site.

This module is compatible with Drupal 8 and 9.

Installation

Install this module via composer by running the following command:

composer require drupal/js_editor

Basic usage

  1. Install the module
  2. Go to /admin/appearance
  3. Edit an Installed theme
  4. At the bottom of te page activate the checkbox "Enable or disable custom JS"
  5. Enter your custom Javascript code
  6. Save the configuration

Similar Modules

  • Asset Injector: has the same functionality.
    • Advantage: Javascript Editor configuration is available in the theme settings.
  • CSS Editor: allows site builders to customize a theme's CSS through the browser.
Supporting organizations: 

Project information

Releases