Forums

How to change the default settings of the wysiwyg editor

ilansch 14 Jun, 2019
Hi,

I have a text area with wysiwyg editor enabled. By default when the form opens, the "Show block" button is pressed which shows an outline on all paragraphs which confuses the visitors.

Is there way to change that so the button is not pressed by default?

I tried to attach a couple of images in this post but I get the following error message: "Error saving the attachment file.".

Thanks in advance
healyhatman 15 Jun, 2019
I don't think there's a way to do it with vanilla, but you can call the tinymce text editor yourself with javascript and set its initial settings there yourself. Don't ask me how though, I don't know🙂
ilansch 18 Jun, 2019
Thanks for the comment,

I tried a few things with javascript but at the end I hacked the code and now the hard part will be to find a way to remember to re'hack after upgrades, maybe there is a joomla hook that I could use to run a script after upgrades...

In case someone needs it, here is the hack:

I found that the file that sets the default is:

/libraries/cegcore2/assets/js/g2.tinymce.js

and on line 28 I changed from:
                         visualblocks_default_state: true,
to:
                         visualblocks_default_state: false,

I wonder why the default was set as true.

If someone knows a better way to set the default, I will appreciate it.

Regards,
GreyHead 18 Jun, 2019
Hi,

There is a FAQ for setting up alternative editors and custom editor settings linked to a plain textarea element in a chronoform. It's written for earlier versions of CF but the same method should work for CFv6.

Bob
This topic is locked and no more replies can be posted.