External configuration of TinyMCE Rich Text Editor

I’ve just been setting up TinyMCE Rich Text Editor with an external config file and wanted to share a few helpful details I figured out ‘the hard way’. Adding them here in the absence of a specific docs page for the extra.

The text file containing the config can be anywhere in your site and should contain settings in JSON form.
{"skin":"lightgray","min_height":500}

To configure the path to the file containing this text, set tinymcerte.external_config in system settings to be the absolute file-system path to the file.

There are three placeholders available:
{base_path} - points to the base of your MODX install
{core_path} - points to the core folder
{assets_path} - points to the assets folder

For example, a file placed at
/core/components/tinymcerteassets/tinymcerte.conf.txt
should have a system setting of {core_path}components/tinymcerteassets/tinymcerte.conf.txt

Putting it into the core folder means it’s blocked from public web reading if your install is secured correctly and using {core_path} acts as placeholder that populates with the full server path, keeping this setting safe across different MODX installs.

5 Likes