xguenel/module-collapsible-toggle

Magento 2 module that allows you to expand/collapse all collapsible elements in the Magento back-office using keyboard shortcuts.

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Language:HTML

Type:magento2-module

pkg:composer/xguenel/module-collapsible-toggle

1.0.0 2025-12-17 08:01 UTC

This package is not auto-updated.

Last update: 2025-12-18 06:50:48 UTC


README

Magento 2 module that allows you to expand/collapse all collapsible elements in the Magento back-office using keyboard shortcuts.

Description

This module adds convenient keyboard shortcuts to improve Magento administrator productivity. It allows you to quickly open or close all collapsible panels on an admin page, particularly useful on system configuration pages.

Features

  • Expand All Elements: Opens all collapsible panels on the current page
  • Collapse All Elements: Closes all collapsible panels on the current page
  • macOS Compatibility: Automatically uses the Command key (⌘) on macOS instead of Ctrl
  • Configurable Shortcuts: Shortcut keys can be customized from the administration
  • Enable/Disable: The module can be enabled or disabled from the configuration

Supported Elements

The module handles several types of Magento collapsible elements:

  • Configuration sections (.section-config)
  • Collapsible panels ([data-role="collapsible"])
  • Admin collapsible blocks (.admin__collapsible-block-wrapper)
  • Fieldset wrappers (.fieldset-wrapper)

Requirements

  • Magento 2.4.x
  • PHP 8.1 or higher

Installation

Manual Installation

  1. Create the module directory:

    mkdir -p app/code/Xguenel/CollapsibleToggle
  2. Copy the module files to this directory

  3. Enable the module:

    bin/magento module:enable Xguenel_CollapsibleToggle
  4. Update the database and recompile:

    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento cache:flush

Configuration

Access the module configuration via:

Stores > Configuration > Xguenel Extensions > Collapsible Toggle

Available Options

Option Description Default Value
Enable Module Enables or disables the module Yes
Expand All Key Key to expand all elements (with Ctrl/Cmd + Shift) A

Usage

Default Keyboard Shortcuts

Action Windows/Linux macOS
Expand or Collapse all elements Ctrl + Shift + A ⌘ + Shift + A

How to Use

  1. Log in to the Magento back-office
  2. Navigate to a page containing collapsible elements (e.g., System > Configuration)
  3. Use the keyboard shortcuts to expand/collapse all elements

Module Structure

Xguenel/CollapsibleToggle/
├── Block/
│   └── Adminhtml/
│       └── CollapsibleToggle.php             # Block to retrieve configuration
├── etc/
│   ├── acl.xml                               # ACL permissions definition
│   ├── adminhtml/
│   │   └── system.xml                        # Admin system configuration
│   ├── config.xml                            # Default configuration values
│   └── module.xml                            # Module declaration
├── view/
│   └── adminhtml/
│       ├── layout/
│       │   ├── adminhtml_dashboard_index.xml # Dashboard layout
│       │   ├── catalog_product_index.xml     # Product index layout
│       │   ├── default.xml                   # Default layout
│       │   └── sales_order_index.xml         # Order index layout
│       └── templates/
│           └── collapsible-toggle.phtml      # Template with JavaScript
├── composer.json                             # Composer dependencies
├── LICENSE                                   # License file
├── registration.php                          # Module registration
├── README.md                                 # This file (English)
└── README_FR.md                              # French documentation

ACL Permissions

The module defines an ACL permission for configuration access:

  • Xguenel_CollapsibleToggle::config - Access to module configuration

Browser Compatibility

The module is compatible with all modern browsers supporting:

  • ES5 JavaScript
  • jQuery (included in Magento)
  • The KeyboardEvent API
  • The User-Agent Client Hints API (with fallback to navigator.userAgent for older browsers)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Xguenel

© 2025 Xguenel. All rights reserved.

Support

For any questions or issues, please create an issue in the project repository.

Changelog

Version 1.0.0

  • Initial release
  • Keyboard shortcuts to expand/collapse collapsible elements
  • macOS support with Command key
  • Customizable key configuration
  • Module enable/disable option