This project is not covered by Drupal’s security advisory policy.
Provides layouts for use in Layout Builder that have regions (AKA slots) that can be configured to be collapsed or collapsible. It uses the details HTML element, so no JavaScript is needed.
Features
Has multiple regions – up to five – in each column and provides one, two, (planned) three, and (planned) four column layouts.
Post-Installation
Inside layout builder, add one of the Layout Collapse layouts, such as Two column layout with collapsible regions.
For each region, set whether you want it to be an optionally titled regular div, an open details, a closed details, or a titled section.
Add the text for the summary or title, if desired.
Caveat: Regions do not currently show their labels (for unknown reasons, help welcome) so you have to count the regions to know when the second column starts; there are five regions per column so the second column starts at the sixth region.
You are expected to leave many regions blank. The reason there are so many is so that you can have a series of collapsed details elements in the right-hand column, say, while the left-hand column is a normal single section.
Additional Requirements
Recommended modules/libraries
None yet.
Similar projects
Everything that provides layouts? But nothing provides layouts like this that i could find.
Supporting this Module
You can support Agaric's overall contributions to Drupal and a bit beyond by supporting Drutopia at opencollective.com/drutopia. Thanks!!
Community Documentation
Contributions documenting your use very welcome.
Motivation
A site builder can choose to display fields within an accordion in Drupal's Layout Builder.
That simple user story launched me on a journey of frustration and, ultimately, making this module.
Putting fields in the HTML details element (no-JS open and close fieldset) in Drupal's Layout Builder can't be that difficult, can it?
Well, needing to allow a site-builder to put some fields in a collapsible section (HTML details element) led to an entire day of frustration learning in detail that core layouts supports zero nesting or modification of section elements, testing Layout Components (requires CKEditor 4?!?), and testing Layout Builder plus (2.x a literal non-starter, 3.x doesn't quite work yet?), which led me to the regretful conclusion that my best hope is creating a custom section layout that includes slots that can be configured to use different wrapping elements (div, section, details, with the configurable labels) which led me to the Layout Options module which led to making this module.
Future plans
May further embrace Single Directory Components by using UI Patterns 2.x in the future.
Project information
- Project categories: Content display, Content editing experience
- Ecosystem: Layout Options
- Created by mlncn on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
