Jump to content

Accordion block for TinyMCE in PW


TomPich
 Share

Recommended Posts

Hey,
The new version of PW (3.0.244/246) is great, and it uses TinyMCE 6.8.
I saw that in this version of TinyMCE, there is a plugin that manages <detail> and <summary> tags. That was not possible in TinyMCE 6.4, used in the former version of PW (3.0.224).
However, this plugin is not displayed in the TinyMCE input fields configuration interface. It’s just completely ignored.
It can be activated though if you add it directly in the input field config in the database and it works perfectly. So it’s just a matter of user interface to get it straight in PW.
Would it be possible to take it into account in the admin interface? That means see this plugin in the plugin lists of TinyMCE, and add the "accordion" button in the tool bar.
Thanks

Link to comment
Share on other sites

Have you already added the plugin into the InputfieldTinyMCE's External Plugin Files section, and then configured both the module and the field to use it? I'm just wondering if the module, and then field config would take care of your manual database edit.

Link to comment
Share on other sites

  • 3 weeks later...

Hey @TomPich, I don't know if you gave it a try, but I just did. Although I was able to get the button to work after manually modifying InputfieldTinyMCEConfig.php, I wasn't able to get it to actually work using the default interface of a Textarea field's Input config for TinyMCE fields. As the Accordion plugin is not an external plugin, there doesn't seem to be a simple way to use the UI of the field's Input config settings to enable the accordion.

I played around a bit, and did get it to work, but after saving the injected "accordion" (details/summary elements), the HTML of those elements got stripped via HTMLPurifier, so there's another problem. Turning off HTMLPurifier allowed it to work, though I'm not sure if you'd want to do that. There's another recent topic where someone is attempting to adjust HTMLPurifier a bit.

Currently, it seems that to get the Accordion plugin to work until/unless the core TinyMCE module is updated to include it, you'd currently have to migrate your customized settings via the field's UI into a custom JSON that overrides what you have set via the field UI.

Example "Custom Settings JSON" (PW default + accordion):

{
  "plugins": ["anchor", "code", "link", "lists", "pwimage", "pwlink", "table", "accordion"],
  "toolbar": ["styles bold italic pwlink pwimage blockquote hr bullist numlist table anchor code accordion"]
}

After playing around with the accordion interface, I don't find it quite as intuitive as some other elements, but it does work.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...