What would be the cleanest way to customize the editor for Wysiwyg field ?

Permalink Browser Info Environment
Hi,

I would like to customize the WYSIWYG editor - mainly I would like to remove plugin to enable only a subset of the functionalities of CKeditor that make sense in the context of the block I'm creating. What would be the cleanest and most maintainable way to do that in your addon ?

Type: Discussion
Status: Resolved
dangrth
View Replies:
ramonleenders replied on at Permalink Reply
ramonleenders
Hi there,

This currently is not possible. I suspect you want to be able to, let's say, just enable bold/italic/underline and also maybe have the in a specific order?

Kind regards,
Ramon
dangrth replied on at Permalink Reply
dangrth
Yes, that's exactly that.
I have already customized CKEditor sitewide for full page rendition of rich text.
But I have smaller blocs created with your addon where it only makes sense to allow inline HTML elements in rich text - so italic, bold and links.
I could instruct editors not to include gigantic images and h2 level elements in a 350x350 bloc, but we all know they will eventually do that if they can ;)
ramonleenders replied on at Permalink Reply
ramonleenders
Yeah, understand that editors could go wild whenever they can. I will have to put it on my backlog, there's currently so much other stuff going on and it's not small enough to pick up straight away unfortunately.

Not sure how advanced with coding you are yourself, but I am also open to edits from users (instead of it being a one-man-project forever haha).

Kind regards,
Ramon
dangrth replied on at Permalink Reply
dangrth
I will probably look into updating it myself - the problem as always is lack of time ;) It does seem you can override across packages, I did not know you could do that ! I have to look into that, that would be pretty neat...
dangrth replied on at Permalink Reply
dangrth
Hi ! I made the update. Usage is as follow. I could not figure out how to override a PHP class from one package in another. Maybe you could add the small change to future releases. I could send you the code, it seems I'm not allowed to insert PHP files here...

"summary" => [
      "type"        => "Wysiwyg",
      "label"       => t("Résumé"),
      "config"     => [
        "exclude_plugins" => [
          'blockquote', 'font', 'format', 'horizontalrule', 'image', 'image2', 'indentblock', 'indentlist', 'justify',
          'list', 'liststyle', 'pasteFromWord', 'stylescombo', 'table', 'tableresize', 'tableselection', 'tabletools',
          'concrete5uploadimage', 'concrete5styles', ''
        ],
      ],
    ],
ramonleenders replied on at Permalink Reply
ramonleenders
If you still have this code, let me know. Would be happy to implement this if you have it all ready and functional!

Kind regards
Ramon
dangrth replied on at Permalink Reply
dangrth
Hi. I still have the code, I juste have to locate it in the right project ;) Where can I send it ?
ramonleenders replied on at Permalink Reply
ramonleenders
You can send it by PM. If it doesn't allow .php, do it as a .txt!
dangrth replied on at Permalink Reply
dangrth
I found back the files, it's just a simple modification. However, I don't seem to find private messages anymore on the update forum ?!
ramonleenders replied on at Permalink Reply
ramonleenders
Just released version 1.4.0 that includes this functionality!

Kind regards
Ramon

concrete5 Environment Information

N/A

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.