Skip to content

Kirby TinyMCE Field

Ahmet Bora edited this page Sep 15, 2022 · 1 revision

Integrates the powerful TinyMCE 5 wysiwyg editor into Kirby 3.

All the documentation about Plates template engine is in the official documentation. You can find information in documents about getting API KEY: Quick start

preview

Installation

  1. Download the latest release
  2. Unzip downloaded file
  3. Copy/paste unzipped folder in your /site/plugins folder

Usage

fields:
  text:
    label: Content
    type: tinymce
    placeholder: "Enter text.."
    height: 750

Options

Option Type Description
apiKey string API Key for TinyMCE (required)
height int string Sets the height of the entire editor, including the menu bar, toolbars, and status bar.
imageAdvanceTab boolean Advanced tab to the image dialog allowing you to add custom styles, spacing and borders to images.
menubar string boolean Allows you to specify which menus should appear and the order that they appear in the menu bar at the top of TinyMCE.
placeholder string Adds placeholder content that will be shown when the editor is empty.
plugins array Used to include plugins for the editor.
toolbar string array Allows you to specify the buttons and the order that they will appear on TinyMCE’s toolbar

All the values can be updated in the config.php file with prefixed owebstudio.tinymce.

Defaults

Option Default
apiKey null
height 500
imageAdvanceTab true
menubar file edit view insert format tools table tc help
placeholder null
plugins ['advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table paste code help wordcount']
toolbar undo redo | formatselect | bold italic forecolor backcolor | alignleft aligncenter | alignright alignjustify | bullist numlist outdent indent | removeformat | code fullscreen

Sample options

<?php

// /site/config/config.php
return [
    'owebstudio.tinymce' => [
        'apiKey' => 'YOUR_API_KEY',
        'height' => 750,
    ]
];