# Drupal Installation

> Editor42 for Drupal 10 and 11, a free text editor module: a toolbar you build by dragging, image uploads stored as site files and the Media Library.

Source: https://editor42.com/docs/install/drupal  
Section: Installation > CMS > Drupal  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

The Editor42 module brings Editor42 to Drupal 10 and 11 as a text editor you choose per text format, in the same list as the editor Drupal ships. It is free and open source, needs no account and no API key, and loads nothing from outside your site.

## Why Editor42 on Drupal

Editor42 is a maintained fork of the last MIT-licensed TinyMCE, with the fixes listed on the [Security](https://editor42.com/docs/security) page: the menubar and the toolbar people know from TinyMCE, tables, find and replace, and the source code view.

The module connects it to Drupal's own tools. Pictures you upload become files of the site, captions and alignment are stored the way Drupal's filters render them, the Media Library inserts media, and the allowed HTML of each text format decides what the editor writes.

## Step 1: Download the module using Composer

[Editor42](https://www.drupal.org/project/editor42) is on drupal.org. Run the command below in the root of your Drupal project. Composer installs the editor itself with the module, into the `libraries` folder of your site:

```bash
composer require drupal/editor42
```

## Step 2: Enable the module

In **Extend**, tick **Editor42** and press **Install**. Or with Drush:

```bash
drush en editor42
```

Every text format that runs CKEditor and does not limit HTML (**Full HTML** on a standard site) switches to Editor42 at once and moves to the top of the text format list, so content forms offer it first. The formats that limit HTML keep their editor and their filters, and uninstalling the module gives the switched formats back the editor they had.

- [![The Extend page of a Drupal 11 site filtered to Editor42, the module ticked and the Install button under it](https://editor42.com/img/screenshots/docs/integrations/drupal/thumbs/extend-install-module.jpg)](https://editor42.com/img/screenshots/docs/integrations/drupal/extend-install-module.png)

  *Extend: tick Editor42, then Install*

## Step 3: Configure text formats

Open **Configuration → Content authoring → Text formats and editors** and press **Configure** next to **Full HTML**. Its **Text editor** is Editor42 now, and Editor42 is one more choice in that list for every other format.

Build the toolbar under it: drag buttons onto the toolbar and around it, or move them with the keyboard, or load the **Simple** or **Full-featured** preset. **Show the menubar**, **Height** and **Image uploads** follow. On a format that limits HTML, saving adds the tags the toolbar produces to **Allowed HTML tags**, and the message names them.

- [![The Full HTML text format in Drupal with Editor42 as its text editor, the toolbar builder with two lines of buttons, the menubar option and the height](https://editor42.com/img/screenshots/docs/integrations/drupal/thumbs/text-format-toolbar-builder.jpg)](https://editor42.com/img/screenshots/docs/integrations/drupal/text-format-toolbar-builder.png)

  *Full HTML: Editor42 and its toolbar builder*

## ✓ Write with Editor42

Open **Content → Add content** and pick a content type: the body opens in Editor42, in the text format at the top of the list.

- [![A Basic page open in Editor42 in Drupal: the menubar, two lines of toolbar buttons and an article with a captioned picture, a table and a numbered list](https://editor42.com/img/screenshots/docs/integrations/drupal/thumbs/article-edit-form-wysiwyg-editor.jpg)](https://editor42.com/img/screenshots/docs/integrations/drupal/article-edit-form-wysiwyg-editor.png)

  *A Basic page in Editor42 on Full HTML*

## What you get

- A toolbar you build for each text format, by dragging buttons or with the keyboard, or the Simple or Full-featured preset, with the menubar if you want it. A button that needs a filter the format does not have (media, alignment) is left out of the editor.
- Pictures you paste, drop or upload from the image dialog are stored as files of the site, within the format's image upload settings, and Drupal tracks where each one is used.
- Captions and alignment stored as Drupal's own filters render them.
- With the Media Library module, the **Browse** button of the image dialog picks a picture from the library, and it goes into the text as that file, with its alternative text and its size.
- A click on a picture shows a small toolbar with its settings, the alignment and Remove.
- On a format that embeds media, an **Insert media** button opens the Media Library, and the item you pick shows as the preview Drupal renders for it. A click on the item shows its toolbar, with its caption, its own alternative text and its display.
- Text in a right-to-left language runs right to left, and for screen readers the editing area is named after its field.
- On a format that limits HTML, the list of allowed tags stays yours: saving the format adds what the toolbar produces and says what it added, and the editor writes only what the list allows.
- Editor42 in content forms, in Drupal's dialogs and in the Layout Builder side tray.
- The text in your theme's styles while you edit: a theme names its stylesheets under `editor42-stylesheets` in its info file, or keeps the `ckeditor5-stylesheets` it already has.

## Your content stays yours

Editor42 stores standard HTML in the field, as Drupal's own editor does: a caption and an alignment as `data-caption` and `data-align` on the picture, media as `<drupal-media>`, all rendered by Drupal's own filters. The module keeps its settings in the editor configuration of each text format.

## Requirements

- Drupal 10.3 or newer, or Drupal 11
- PHP 8.1 or newer (Drupal 11 needs PHP 8.3)
- The core Text Editor, Filter and File modules, and Media and Media Library for the Insert media and Browse buttons

Everything the module uses is installed on your site and loads from it: no CDN, no accounts, no tracking.

## Source and licence

The module lives on drupal.org as [drupal/editor42](https://www.drupal.org/project/editor42), under the GNU General Public License version 2 or later like every drupal.org project, and its own PHP, JavaScript and CSS ship unminified. The editor keeps its MIT licence: the Composer package `editor42/editor42-drupal` is its build packaged for Drupal ([editor42com/editor42-drupal](https://github.com/editor42com/editor42-drupal)), and its source is at [editor42com/editor42](https://github.com/editor42com/editor42).
