Skip to content

Toolbar ​

The toolbar is set in the system setting tiptapeditor.toolbar. A change takes effect the next time a resource is opened; nothing needs to be rebuilt. A profile can set its own toolbar for some fields.

Syntax ​

  • Item names are separated by spaces (line breaks also work).
  • | starts a new group. Groups are shown with a separator between them.
  • Names are case-insensitive: bulletlist works like bulletList.
  • Unknown names are skipped, so a typo never breaks the editor. With tiptapeditor.debug on, they are reported in the browser console.
  • An item listed twice is shown once.
text
undo redo | heading | bold italic underline | link image | source fullscreen

In a profile or the external config, the toolbar can also be a JSON list. Nested lists are groups:

json
{ "toolbar": ["undo", "redo", "|", "bold", "italic", "|", "link", "source"] }
json
{ "toolbar": [["undo", "redo"], ["bold", "italic"], ["link", "source"]] }

Default toolbar ​

text
undo redo | heading | bold italic underline strike code | color highlight | superscript subscript | align | bulletList orderedList | blockquote horizontalRule | link modxLink anchor | image gallery file table embed | codeBlock | clearFormatting | source fullscreen

After an upgrade

An upgrade keeps your current value of tiptapeditor.toolbar. Buttons added in a newer version appear only after you add them to the setting yourself.

All toolbar items ​

The Button column shows the name you see in the manager (English lexicon).

History and text style ​

ItemButtonWhat it does
undoUndoUndoes the last change (Ctrl/Cmd+Z).
redoRedoRedoes it (Ctrl/Cmd+Shift+Z).
headingText styleMenu: Paragraph and the heading levels from tiptapeditor.heading_levels.
paragraphParagraphTurns the block into a paragraph.
h1 … h6Heading 1 … Heading 6Turns the block into that heading level (or back into a paragraph).
paragraphClassParagraph styleMenu of class presets for paragraphs and headings from tiptapeditor.paragraph_classes. Shown only when presets are set. Other classes of the element stay.

Inline formatting ​

ItemButtonWhat it does
boldBold<strong> (Ctrl/Cmd+B).
italicItalic<em> (Ctrl/Cmd+I).
underlineUnderline<u> (Ctrl/Cmd+U).
strikeStrikethrough<s> (Ctrl/Cmd+Shift+S).
codeInline code<code> (Ctrl/Cmd+E).
superscriptSuperscript<sup> (Ctrl/Cmd+.).
subscriptSubscript<sub> (Ctrl/Cmd+,).
colorText colorColor palette, with Remove color.
highlightHighlightBackground color palette (<mark>), with Remove color.
clearFormattingClear formattingRemoves inline formatting and turns blocks back into paragraphs.

Alignment ​

ItemButtonWhat it does
alignAlignmentMenu with the four options below.
alignLeftAlign leftAligns the paragraph or heading left.
alignCenterAlign centerCenters it.
alignRightAlign rightAligns it right.
alignJustifyJustifyJustifies it.

Blocks ​

ItemButtonWhat it does
bulletListBullet list<ul> (Ctrl/Cmd+Shift+8).
orderedListNumbered list<ol> (Ctrl/Cmd+Shift+7).
blockquoteQuote<blockquote> (Ctrl/Cmd+Shift+B).
horizontalRuleHorizontal lineInserts <hr>.
codeBlockCode block<pre><code> (Ctrl/Cmd+Alt+C). MODX tags inside stay plain text.
ItemButtonWhat it does
linkLinkOpens the link dialog (Ctrl/Cmd+K).
modxLinkMODX resourceOpens the link dialog on the MODX resource search.
unlinkRemove linkRemoves the link under the cursor and keeps the text.
anchorAnchorSets the anchor (id) of the current heading. Active only in a heading.

Media and embeds ​

ItemButtonWhat it does
imageImageOpens the image dialog: Media Browser, upload from the computer or copy by link. With an image selected: edits it.
galleryGalleryOpens the gallery dialog. Hidden when the field has neither a Media Source you may browse nor uploads.
fileLink to a fileMedia Browser: the selected text becomes a link to the file, or the file name is inserted as the link text. Disabled without access to the Media Source.
embedVideo or embedOpens the dialog for a YouTube, VK Video or Rutube link, an embed URL or <iframe> code.
imageUploadImage from computerOptional. Picks a file, uploads it, then opens the image dialog. With an image selected, replaces only its file. Shown only when uploads are enabled.
imageUrlImage by URLOptional. Copies a picture from a web address to the site, then opens the image dialog. Shown only when uploads are enabled.

Tables ​

ItemButtonWhat it does
tableTableInserts a table (dialog). In a table: opens its properties.
addRowBeforeInsert row above
addRowAfterInsert row below
deleteRowDelete row
addColumnBeforeInsert column left
addColumnAfterInsert column right
deleteColumnDelete column
toggleHeaderRowHeader row on/off
toggleHeaderColumnHeader column on/off
mergeCellsMerge cellsMerges the selected cells.
splitCellSplit cellSplits a merged cell.
tablePropertiesTable propertiesCSS classes of the table.
deleteTableDelete table

The table commands appear anyway on the table toolbar while the cursor is in a table. You can also put them into the main toolbar.

View ​

ItemButtonWhat it does
sourceHTML sourceSwitches to the HTML source and back.
fullscreenFullscreenFullscreen mode; Escape leaves it.

When a button is hidden or disabled ​

ConditionEffect
tiptapeditor.enable_tables offtable and all table commands are hidden.
tiptapeditor.enable_images offimage, imageUpload, imageUrl and gallery are hidden.
tiptapeditor.enable_gallery offgallery is hidden.
tiptapeditor.enable_iframe offembed is hidden.
tiptapeditor.enable_fullscreen offfullscreen is hidden.
A level missing from tiptapeditor.heading_levelsThat h1 … h6 item is hidden and the level is not in the heading menu.
tiptapeditor.upload_enabled off, or no Media SourceimageUpload and imageUrl are hidden.
No access to the field's Media Sourcefile is disabled; the image dialog has no Choose in Media Browser… button.
An extension switched off in a profile or the external config (for example "highlight": false)Its buttons are hidden.
Button cannot act here (for example unlink outside a link)Disabled.

Examples ​

A short toolbar for an introduction TV:

text
bold italic link | bulletList | source

An article toolbar with paragraph styles and the optional upload buttons:

text
undo redo | heading paragraphClass | bold italic underline | align | bulletList orderedList blockquote | link modxLink anchor | image imageUpload imageUrl gallery file | table embed | source fullscreen

Buttons added by other extras with TipTapEditor.registerToolbarItem() are used by name in the same way (see JS API).