AndyWizz
AndyWizz

Reputation: 113

Config TinyMCE, TinyMCErte by a external config JSON-File

In MODX Revo, TinyMCErte I try to configure the PlugIn via the key tinymcerte.external_config. The config-File has to be valid JSON. Here is my block, it is ignored. I want TinyMCE not to convert special characters like german umlaute (öäü) and of cource & should stay & and not &

tinymce.init({
    forced_root_block : false,
    entity_encoding : "raw"
})

Upvotes: 0

Views: 1555

Answers (3)

The configuration is connected from the side of php. Therefore, the absolute and relative paths do not work.

Use this kinds of location:

"{base_path}/file.cfg"
"{core_path}/file.cfg"
"{assets_path}/file.cfg"

Upvotes: 0

achterbahn
achterbahn

Reputation: 50

  1. TinyMCE Rich Text Editor (Ver. 1.1.1) is reading the external config file.
  2. the path could be e.g. ../assets/components/tinymcerte/ext-config.json, but it would be advisible to store it in a non web accesible place. Although this github-entry implies that it reads external config files vom core-path, assets-path and base-path I was not able to get it to work.
  3. the content of the external config file has to be valid JSON:

{ "forced_root_block" : false, "entity_encoding" : "raw" }

  1. The keys must be wrapped in "", in contrast to "native" TinyMCE settings (but not sure on this one...)

Upvotes: 1

AndyWizz
AndyWizz

Reputation: 113

I did not managed to get the external config file working. I tried an absolute link and a relative. The file did not load anyway.

I edited the file tinymcerte.js in assets\components\tinymcerte\js\mgr

after this in line 60 tinymce.init(this.cfg);

I put in my configuration before closing the }:

  tinymce.init({
      selector: "#ta",
      schema: 'html5',
      element_format : 'xhtml',
      forced_root_block : false,
      entity_encoding : 'raw'
    })

Nevertheless the next update of the extra will destroy this fiddle.

Upvotes: 0

Related Questions