https://github.com/acid-unit/module-admin
Magento Open Source and Adobe Commerce Acid Unit helper admin extension
https://github.com/acid-unit/module-admin
ecommerce magento magento-2 magento-2-extension magento-2-extension-free magento-2-extensions magento-2-module magento-2-modules magento-extension magento-module magento2 magento2-extension magento2-extension-free magento2-extensions magento2-extensions-free magento2-free-extension magento2-free-modules magento2-module magento2-module-free magento2-plugin
Last synced: 5 months ago
JSON representation
Magento Open Source and Adobe Commerce Acid Unit helper admin extension
- Host: GitHub
- URL: https://github.com/acid-unit/module-admin
- Owner: acid-unit
- License: osl-3.0
- Created: 2025-01-11T22:46:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-12T14:55:50.000Z (over 1 year ago)
- Last Synced: 2025-10-11T02:26:48.255Z (8 months ago)
- Topics: ecommerce, magento, magento-2, magento-2-extension, magento-2-extension-free, magento-2-extensions, magento-2-module, magento-2-modules, magento-extension, magento-module, magento2, magento2-extension, magento2-extension-free, magento2-extensions, magento2-extensions-free, magento2-free-extension, magento2-free-modules, magento2-module, magento2-module-free, magento2-plugin
- Language: PHP
- Homepage: https://acid.7prism.com
- Size: 75.2 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
A **Magento Open Source** extension that enhances the **admin panel experience**
with additional tools, tweaks and customization options.
This module:
✅ **Enhances the admin interface** with additional configuration tools.
✅ Improves menu management for better navigation within Acid Unit extensions.
✅ Acts as a dependency for all Acid Unit extensions, ensuring consistent admin functionality.
## Quick Installation
To install the module, run:
```shell
composer require acid-unit/module-admin
```
## Admin Features Overview
* [Configuration-Based Tweaks](#configuration-based-tweaks)
+ [WYSIWYG for PageBuilder `HTML Code` Element](#wysiwyg-editor-for-pagebuilder--html-code--element)
* [Code-Based Tweaks](#code-based-tweaks)
+ [WYSIWYG for Textarea Fields](#wysiwyg-editor-for-textarea-fields)
+ [Table Field](#table-field)
## Configuration-Based Tweaks

### WYSIWYG Editor for PageBuilder `HTML Code` Element
#### Description
Enabling this option allows users to edit content **visually** instead of dealing with raw HTML,
reducing errors and **improving content management efficiency**.
Since the `HTML Code` element is powerful yet complex, this configuration
lets **admin users toggle the WYSIWYG editor** inside the element for **quicker editing**.
#### Demo

## Code-Based Tweaks
### WYSIWYG Editor for Textarea Fields
#### Description
Provides **HTML editing** directly within the admin field,
providing a **lightweight alternative to PageBuilder** for small-to-medium content sections.
This feature allows admins to manage structured data efficiently, making it easier
to configure settings like custom redirects, tracking events, and more.
#### Implementation
The **toggle button** should be defined as a new `` element with the following structure:
```xml
...
page_form_editable_field
AcidUnit\Admin\Block\Adminhtml\System\Config\Form\Field\ToggleEditorButton
```
📌 Ensure the `sortOrder` value for the toggle button is higher than the target field
so that it appears **directly beneath it**.
#### Demo

### Table Field
#### Description
The Table Field is useful for storing structured data in the admin panel, like custom redirects,
event tracking mappings, or configurable lists.
Below is how to define it in `system.xml`.
#### Implementation
To render a **table field**, define the `` and ``
classes in your `` element:
```xml
...
VendorName\VendorModule\Block\Adminhtml\Form\Field\YourCustomTableField
VendorName\VendorModule\Model\System\Config\Backend\YourCustomTableField
```
**Backend & Frontend Virtual Models**
Define virtual classes for **backend**, **frontend**, and **helper models**:
```xml
enabled
url
event
VendorName\VendorModule\Helper\YourCustomTableField
Enabled
VendorName\VendorModule\Block\Adminhtml\Form\Field\Yesno
Page URL
admin__control-text required-entry
Event Name
admin__control-text required-entry
Add Custom Page
```
📌 Note: Ensure all virtual classes are compiled before deployment.
**Dropdown Renderer for Table Fields**
```php
setName($value);
}
/**
* Dropdown options are set in this method
* First addOption() parameter is an option value, second parameter is an option label
* @return string
*/
public function _toHtml(): string
{
if (!$this->getOptions()) {
$this->addOption('1', __('Yes'));
$this->addOption('0', __('No'));
}
return parent::_toHtml();
}
}
```
📌 Compile & Deploy:
```shell
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
```
#### Demo

#### Additional Notes
The **Table Field value** is stored as a **stringified object** and can be handled like any regular admin text field.
- On the frontend, use `JSON.parse`.
- On the backend, use `\Magento\Framework\Serialize\Serializer\Json::serialize`.
to parse and manipulate the data.
# Installation
If you're using another Acid Unit extension, this module is installed automatically as a dependency.
However, if you want to use these Admin Features separately, install the module manually.
```shell
composer require acid-unit/module-admin
```
After installation, enable the module and run `setup:upgrade`:
```shell
bin/magento module:enable AcidUnit_Admin
bin/magento setup:upgrade
```
# Requirements
✅ **Compatible with**: Magento Open Source & Adobe Commerce `>=2.4.4`
✅ Requires `PHP 8.1+`
🛠 **Tested on** Magento Open Source `2.4.7-p3` with `PHP 8.3`