Skip to main content
UW Drupal Users Group

CKEditor Accordion Patch

The CKEditor Accordion module provies a CKEditor plugin for creating an accordion.

Unfortunately it's not very accessible.

Thankfully someone opened an issue and another user created a patch for version 7 and 8.

Unfortunately there were still a couple additional issues with this patch:

  • The caret that showed the open / closed state of the accordion was not clickable
  • There was no hover state
  • There was no UW Purple! 

I re-rolled the patch to address these last few issues and you can download the new patch below.

  1. Download CKEditor Accordion Module v 7.x-1.1
    drush dl ckeditor_accordion-7.x-1.1 
  2. Copy this patch file into the PARENT directory 
  3. From command line run: patch -p0 < name-of-the-file.patch
  4. Enable CKEditor Accordion Module
  5. Config ckeditor_accordion module at: admin/config/content/ckeditor_accordion
    1. Check "Collapse all tabs by default" 
  6. Config ckeditor at: admin/config/content/ckeditor
    1. Edit profile -> EDITOR APPEARANCE -> Plugins -> Enable CKEditor Accordion
    2. Add the accordion button to your toolbar 
    3. Edit profile -> ADVANCED OPTIONS -> Custom JavaScript configuration add:
      config.extraAllowedContent = 'div(*)[*]{*}; dl(*); dt[aria*](*); span(*); a(*); dd[aria*](*)';

 

See patch at:
https://gist.github.com/druliner/4d443aa9d32d27a2031ae5815ff57ee9