Add Option open and close in accordion

Created on 30 July 2023, over 1 year ago
Updated 27 February 2024, 9 months ago

Problem/Motivation

It would be interesting to have the option so that the accordion can appear open or closed and you can change it in whatever you need, I don't know how feasible it is but that option would make the module more powerful

✨ Feature request
Status

Needs work

Version

2.0

Component

User interface

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Nelo_Drup
  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin

    At the moment there is a global option at `/admin/config/content/ckeditor-accordion`. But having an option for the individual accordions requires some changes.

  • First commit to issue fork.
  • Status changed to Needs work 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I took a stab at updating the plugin to have the option, but haven't finished implementing the feature. The issue fork has a working UI.

    I'm newish to ckeditor plugins so still learning the options for implementing widgets like the form input and balloon selection.

    I got a lot of it from https://ckeditor.com/docs/ckeditor5/latest/tutorials/abbreviation-plugin....

    Some things to consider.

    For a single accordion, its straightforward, just open or closed by default. But how to account for the global setting? Should we default to the global and treat this as an override? If the global is switched, it wouldn't change existing accordions that have this setting changed, unless the options are open, closed, default.

    For multiple accordion rows, there is a global option to open one at a time. Maybe that should be an override per accordion as well. If it's set, the UI should let you pick the one to open and not allow selecting multiple. If it's not set, the open/closed setting could be set per row.

    So I think there should be some settings per accordion - open/close all or open one at a time. Then per accordion row, conditionally allow setting open/closed.

Production build 0.71.5 2024