Magento 2 Admin UI & System Configuration
Before writing code
Fetch live docs:
- Fetch
https://developer.adobe.com/commerce/php/development/components/ for admin grid tutorial
- Fetch
https://developer.adobe.com/commerce/php/development/ for ACL tutorial
- Web-search
site:developer.adobe.com commerce php development components ui-components for UI component reference
Admin Grids (UI Component Listings)
How Admin Grids Work
Grids are XML-declared UI components backed by data providers. They render in the browser using KnockoutJS and load data via AJAX.
Grid XML Structure (ui_component)
Located in view/adminhtml/ui_component/<listing_name>.xml:
<listing> root element with data source
<dataSource> — data provider class and configuration
<listingToolbar> — bookmarks, columns controls, filters, mass actions, paging
<columns> — column definitions (type, label, sortable, filterable)
<column> — individual column (text, select, date, actions)
<actionsColumn> — edit/delete action links
Data Provider
- Extends
Magento\Ui\DataProvider\AbstractDataProvider
- Backed by a collection (resource model collection)
- Provides data array to the grid
Mass Actions
Bulk operations on selected rows:
- Delete, status change, export
- Declared in grid XML under
<massaction>
- Each action maps to a controller
Admin Forms (UI Component Forms)
Located in view/adminhtml/ui_component/<form_name>.xml:
<form> root element
<fieldset> groups related fields
<field> — input, textarea, select, multiselect, boolean, date, imageUploader, wysiwyg
- Data provider loads entity data for editing
- Save controller processes form submission
System Configuration
system.xml
Defines admin config fields at Stores > Settings > Configuration:
<section> — top-level tab
<group> — fieldset within a section
<field> — individual configuration field
- Field types: text, textarea, select, multiselect, obscure (password), image
config.xml
Provides default values for system configuration fields. Path format: section/group/field.
Reading Config Values
$this->scopeConfig->getValue('section/group/field', ScopeInterface::SCOPE_STORE);
Scopes: default, website, store (store view).
ACL (Access Control List)
acl.xml
Defines resource hierarchy:
- Nested
<resource> elements form a permission tree
- Admin users are assigned to roles; roles get resource permissions
Controller ACL
Admin controllers extend Magento\Backend\App\Action:
const ADMIN_RESOURCE = 'Vendor_Module::resource_name';
- Framework checks ACL before executing action
Menu Items
Declared in etc/adminhtml/menu.xml:
- Maps to ACL resources
- Defines position in admin sidebar navigation
Admin Controllers
- Extend
Magento\Backend\App\Action
- Route in
etc/adminhtml/routes.xml
- URL:
admin/<frontName>/<controller>/<action>
- Common patterns: Index (list), Edit, Save, Delete, MassDelete, NewAction
Best Practices
- Always create ACL resources for every admin feature
- Use UI component grids over custom HTML grids
- Provide bookmarks and export in grids
- Validate form data server-side (never trust client)
- Use
resultPageFactory for rendering admin pages with proper layout
- Scope config values appropriately (global vs website vs store view)
Fetch the admin grid tutorial, ACL guide, and UI component reference for exact XML schemas and data provider patterns before implementing.
1---2name: magento-admin-ui3description: Build Magento 2 admin interfaces — UI component grids, forms, system configuration, ACL, and admin controllers. Use when creating admin panels, data grids, edit forms, or system settings.4allowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch5metadata:6 source: https://skillmd.com/skills/orcaqubits/magento-admin-ui7---89# Magento 2 Admin UI & System Configuration1011## Before writing code1213**Fetch live docs**:141. Fetch `https://developer.adobe.com/commerce/php/development/components/` for admin grid tutorial152. Fetch `https://developer.adobe.com/commerce/php/development/` for ACL tutorial163. Web-search `site:developer.adobe.com commerce php development components ui-components` for UI component reference1718## Admin Grids (UI Component Listings)1920### How Admin Grids Work2122Grids are XML-declared UI components backed by data providers. They render in the browser using KnockoutJS and load data via AJAX.2324### Grid XML Structure (ui_component)2526Located in `view/adminhtml/ui_component/<listing_name>.xml`:27- `<listing>` root element with data source28- `<dataSource>` — data provider class and configuration29- `<listingToolbar>` — bookmarks, columns controls, filters, mass actions, paging30- `<columns>` — column definitions (type, label, sortable, filterable)31- `<column>` — individual column (text, select, date, actions)32- `<actionsColumn>` — edit/delete action links3334### Data Provider3536- Extends `Magento\Ui\DataProvider\AbstractDataProvider`37- Backed by a collection (resource model collection)38- Provides data array to the grid3940### Mass Actions4142Bulk operations on selected rows:43- Delete, status change, export44- Declared in grid XML under `<massaction>`45- Each action maps to a controller4647## Admin Forms (UI Component Forms)4849Located in `view/adminhtml/ui_component/<form_name>.xml`:50- `<form>` root element51- `<fieldset>` groups related fields52- `<field>` — input, textarea, select, multiselect, boolean, date, imageUploader, wysiwyg53- Data provider loads entity data for editing54- Save controller processes form submission5556## System Configuration5758### system.xml5960Defines admin config fields at Stores > Settings > Configuration:61- `<section>` — top-level tab62- `<group>` — fieldset within a section63- `<field>` — individual configuration field64- Field types: text, textarea, select, multiselect, obscure (password), image6566### config.xml6768Provides default values for system configuration fields. Path format: `section/group/field`.6970### Reading Config Values7172```php73$this->scopeConfig->getValue('section/group/field', ScopeInterface::SCOPE_STORE);74```7576Scopes: default, website, store (store view).7778## ACL (Access Control List)7980### acl.xml8182Defines resource hierarchy:83- Nested `<resource>` elements form a permission tree84- Admin users are assigned to roles; roles get resource permissions8586### Controller ACL8788Admin controllers extend `Magento\Backend\App\Action`:89- `const ADMIN_RESOURCE = 'Vendor_Module::resource_name';`90- Framework checks ACL before executing action9192### Menu Items9394Declared in `etc/adminhtml/menu.xml`:95- Maps to ACL resources96- Defines position in admin sidebar navigation9798## Admin Controllers99100- Extend `Magento\Backend\App\Action`101- Route in `etc/adminhtml/routes.xml`102- URL: `admin/<frontName>/<controller>/<action>`103- Common patterns: Index (list), Edit, Save, Delete, MassDelete, NewAction104105## Best Practices106107- Always create ACL resources for every admin feature108- Use UI component grids over custom HTML grids109- Provide bookmarks and export in grids110- Validate form data server-side (never trust client)111- Use `resultPageFactory` for rendering admin pages with proper layout112- Scope config values appropriately (global vs website vs store view)113114Fetch the admin grid tutorial, ACL guide, and UI component reference for exact XML schemas and data provider patterns before implementing.