Skip to content

Tiptap Rich Text Editor

InputfieldTiptap is a modular, ProseMirror-powered rich text editor for ProcessWire textarea fields. Instead of loading every extension on every page, it splits capabilities into isolated bundles (TiptapCore, TiptapEditor, TiptapCanvas, TiptapBlocks, and strictly lazy TiptapDialogs) loaded on demand based on your chosen field preset.

Select a preset under Setup > Fields > [Your Textarea Field] > Input (after setting Inputfield Type to InputfieldTiptap):

Preset Loaded Runtime Packs Capabilities Included
core TiptapCore Headings, bold/italic/underline/strike, lists, blockquotes, links, undo/redo, clean HTML output
editor TiptapCore + TiptapEditor Tables, code blocks, alignment, highlight/color, superscript/subscript, horizontal rules, native ProcessWire media & link dialogs
canvas TiptapCore + TiptapEditor + TiptapCanvas Slash commands, floating bubble menus, drag-handle block reordering, expanded editorial canvas layout
blocks TiptapCore + TiptapEditor + TiptapCanvas + TiptapBlocks Embedded structured miniBlocks cards inside rich text flow alongside full editorial tooling

Native ProcessWire Dialogs (/_react/tiptap)

Section titled “Native ProcessWire Dialogs (/_react/tiptap)”

When an editor inserts an image, file, or internal page link inside InputfieldTiptap, TiptapDialogs opens a native top-layer <dialog> backed by the signed /_react/tiptap endpoint (TiptapMediaLinkGateway):

  • Search ProcessWire pages by title or path with RBAC-aware results.
  • Upload or pick images and files from the current page or media hosts with full MIME and SVG validation.
  • Configure alt text, alignment, target attributes, and captions without raw HTML editing.

Structured Flat miniBlocks (./site/tiptap/)

Section titled “Structured Flat miniBlocks (./site/tiptap/)”

In the blocks preset, editors can insert reusable structured components (such as callouts, pricing strips, or video embeds) directly inside rich text without nesting full layout trees.

Define flat miniBlocks as YAML or PHP files inside ./site/tiptap/:

  • Directorysite/
    • Directorytiptap/
      • callout.yaml
      • callout.php
      • newsletter-cta.yaml

You can also register miniBlocks programmatically from any module by hooking InputfieldTiptap::registerMiniBlocks:

<?php
declare(strict_types=1);
namespace ProcessWire;
$this->wire()->addHookAfter('InputfieldTiptap::registerMiniBlocks', function (HookEvent $event): void {
/** @var array<string, array<string, mixed>> $blocks */
$blocks = $event->return;
$blocks['callout'] = [
'label' => 'Editorial Callout',
'icon' => 'info',
'fields' => [
['name' => 'tone', 'type' => 'select', 'label' => 'Tone', 'options' => ['info', 'tip', 'warning']],
['name' => 'headline', 'type' => 'text', 'label' => 'Headline'],
['name' => 'body', 'type' => 'textarea', 'label' => 'Message'],
],
];
$event->return = $blocks;
});

Frontend Rendering (TextformatterTiptapMiniBlocks)

Section titled “Frontend Rendering (TextformatterTiptapMiniBlocks)”

To render embedded miniBlocks cleanly on your frontend templates:

  1. Open Setup > Fields > [Your Textarea Field] > Details.
  2. Add Tiptap MiniBlocks (TextformatterTiptapMiniBlocks) under Text formatters.
  3. Output $page->body normally in your template. TextformatterTiptapMiniBlocks resolves each embedded block placeholder through its matching renderer safely.

Complete InputfieldTiptap Configuration Options

Section titled “Complete InputfieldTiptap Configuration Options”

All 16 field-level and module-level configuration keys from InputfieldTiptap::getDefaultConfig() can be configured under Setup -> Fields -> [Field] -> Input or globally in Modules -> Configure -> InputfieldTiptap:

Option Key Default Purpose
preset 'editor' Active capability tier (core, editor, canvas, or blocks).
toolbar default toolbar list Ordered list of top toolbar buttons and groups.
bubbleToolbar default bubble list Floating inline selection toolbar controls (active in canvas and blocks).
headlines ['h2', 'h3', 'h4'] Heading levels exposed in the heading dropdown.
features default features list Enabled ProseMirror/Tiptap extension toggles (tables, highlight, alignment, links, etc.).
toggles ['cleanP', 'removeStyles'] Paste and save cleanup flags (strip empty paragraphs and inline style="" attributes).
height 260 Minimum editor canvas height in pixels.
maxHeight 640 Maximum scrollable editor height in pixels before internal scroll activates.
inlineMode 0 Set to 1 for compact single-line or inline editing without a full chrome frame.
slashMenu 0 Set to 1 to enable / slash command insertion menus.
miniBlocks [] Allowlist of miniBlocks handles permitted inside this field (blocks preset).
imageFields [] Restricts native image insertion dialogs to specific page image fields.
defaultsJSON '' Optional JSON object defining default editor attributes and extension defaults.
extraCSS '' Custom CSS rules injected inside the editor canvas for typography parity.
settingsField '' Optional external field or JSON preset name supplying shared settings.
settingsJSON '' Per-field JSON overrides merged on top of module defaults.

Every save through InputfieldTiptap passes through TiptapContentPolicy and DomFragmentHelper, stripping <script>, event handlers (onclick, onerror), unsafe URL schemes, and disallowed tags before writing to ProcessWire’s database.

Next steps