We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Rich Text Editor - Redactor X, super simple configuration

Development and Programming

Paul Bell's avatar
Paul Bell
104 posts
about 10 months ago
Paul Bell's avatar Paul Bell

I’m trying to create a super simple configuration for the Rich Text Editor, based on Redactor X in EE7.

I want three buttons - Bold, Italic and List.

I can have Bold, Italic and Format, but I only really want list rather than Format. I could probably fudge it by changing the icon for the format menu, which in this config only has paragraph, unordered list and ordered list. (We use this field on the front end so I want it to be as simple as possible.)

Can anyone help me with how to update my RTE config JSON file so that the LIST button appears?

Here’s my Superbasic config:

{
    "toolbar_hide": "y",
    "hide": [
        "html",
        "deleted",
        "link",
        "format"
    ],
    "sticky": "n",
 "toolbar_topbar": "n",
 "toolbar_addbar": "n",
 "toolbar_context": "n",
 "toolbar_control": "n",
 "toolbar_reorder" : "n"
}

I’ve tried adding in “list” in various places where I would think buttons could be added:

{
 "toolbar_hide": "y",
 "toolbar_topbar": "n",
 "toolbar_addbar": "n",
 "toolbar_context": "n",
 "toolbar_control": "n",
 "toolbar_reorder" : "n",
 "sticky": "n",
 "hide": [
  "html",
  "deleted",
  "link",
  "format"
 ],
 "topbar": [
  "shortcut",
  "undo",
  "redo",
  "list"
 ],
 "addbar": [
  "paragraph"
 ],
 "context": [
  "bold",
  "italic"
 ],
 "editor": [
  "bold",
  "italic",
  "list"
 ],
 "toolbar": [
  "bold",
  "italic",
  "list"
 ],
 "format": [
  "p",
  "ul",
  "ol"
 ],
 "plugins": []
}

But it never seems to make any difference.

Another couple of quirks - I can’t seem to override Reorder using the JSON. I can do this by modifying line 65 of RedactorXService.php

$config['toolbar']['reorder'] = false;

Also,

"toolbar_hide": "y",

seems to SHOW the toolbar.

"toolbar_hide": "n",

seems to HIDE the toolbar. Is this expected behaviour?

       
creativearc's avatar
creativearc
68 posts
8 months ago
creativearc's avatar creativearc

Quick note: I was a first-timer on such config tweaks (albeit for Rich Text and CK Editor), and ChatGPT was a big help in corrected my syntax and making general suggestions.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.