An open API service indexing awesome lists of open source software.

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

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

![Configuration-Based Tweaks Overview](https://github.com/acid-unit/docs/blob/main/admin/overview.png?raw=true)

### 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

![Pagebuilder Editor Demo](https://github.com/acid-unit/docs/blob/main/admin/wysiwyg-editor/pagebuilder-editor-demo.gif?raw=true)

## 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

![Admin Field Editor Demo](https://github.com/acid-unit/docs/blob/main/admin/wysiwyg-editor/admin-field-editor-demo.gif?raw=true)

### 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

![Pagebuilder Editor Demo](https://github.com/acid-unit/docs/blob/main/admin/table-field/demo.gif?raw=true)

#### 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`