ibexa/admin-ui
Back-office UI package for the Ibexa DXP admin panel, providing interface components, styling, and assets to manage content and users. Extends the admin experience with ready-to-use views, widgets, and integrations for Ibexa installations.
To start using ibexa/admin-ui in a Laravel project (via Ibexa DXP integration), follow these steps:
Install Ibexa DXP Ensure you have Ibexa DXP installed as a dependency in your Laravel project. This package is part of the DXP ecosystem, so it’s not standalone.
composer require ibexa/dxp
Configure Ibexa Publish and configure Ibexa’s admin UI bundle:
php artisan vendor:publish --provider="Ibexa\AdminUi\AdminUiServiceProvider"
Update config/ibexa.php with your DXP settings (siteaccess, database, etc.).
First Use Case: Custom Field Validation
Extend the back office UI with custom validation for a field type. For example, validate a custom ibexa_string field:
// resources/js/ibexa/admin-ui/field-types/ibexa_string/validator.js
class CustomStringValidator extends window.ibexa.BaseFieldValidator {
validateInput(event) {
const value = event.target.value;
return {
isError: value.length < 5,
errorMessage: 'Minimum 5 characters required',
};
}
}
const validator = new CustomStringValidator({
classInvalid: 'is-invalid',
fieldSelector: '.ez-field-edit-ibexa_string',
eventsMap: [{
selector: '.ez-field-edit-ibexa_string input',
eventName: 'blur',
callback: 'validateInput',
invalidStateSelectors: ['.ez-field-edit-ibexa_string'],
errorNodeSelectors: ['.ez-field-edit-text-zone'],
}],
});
validator.init();
Register the Validator Ensure your validator is loaded by Ibexa’s admin UI. Use a Laravel service provider or a custom JS bundle:
// In your main JS entry point (e.g., resources/js/app.js)
import './ibexa/admin-ui/field-types/ibexa_string/validator';
Pattern: Use BaseFieldValidator to add custom validation logic for existing or new field types.
validateInput to define validation rules.eventsMap to bind validation to specific DOM events (e.g., blur, change).ibexa_url field to ensure it starts with https://.Workflow:
fieldSelector, eventsMap, and error handling.Pattern: Extend or override Ibexa’s UI components using its extensibility points.
IBX-10827 (v5.0.7+):
// Extend rich text toolbar buttons
window.ibexa.RichTextEditorConfig.extend({
toolbar: [
'bold', 'italic', 'customButton', // Add your button
],
customButton: {
handler: () => console.log('Custom button clicked'),
},
});
content edit translation selector extension point (v5.0.7+) to modify language dropdowns.Integration Tips:
ez-admin-ui namespace for component overrides.ez-content-tree./api/ibexa/v2/content). Customize responses or add endpoints:
Route::get('/api/ibexa/v2/custom-data', [CustomController::class, 'index']);
fetch('/api/ibexa/v2/custom-data')
.then(response => response.json())
.then(data => {
// Update UI dynamically
document.querySelector('.custom-placeholder').innerHTML = data.value;
});
config/ibexa.php:
'debug' => env('APP_DEBUG', true),
console.log('Custom event triggered', event); // Check browser console
\Log::info('Custom Ibexa event', ['data' => $data]);
DOM Timing Issues
reinit() to rebind events after DOM changes (e.g., in SPAs or dynamic content).
validator.reinit(); // Rebind after AJAX updates
CSS Selector Mismatches
.ez-field-edit-*). Selectors may break across versions.fieldSelector: '[data-field-type="ibexa_string"]',
Translation Conflicts
trans() helper in PHP.API Versioning
/api/ibexa/v2/ vs /api/ibexa/v3/).OSS vs. DXP Features
IBX-10737) are DXP-only and may throw errors in OSS.if (window.ibexa.isDXP) {
// DXP-only logic
}
Browser DevTools
Network tab (look for ez-admin-ui.js).window.ibexa = { ...window.ibexa, MyCustomConfig: {} };
Laravel Debugging
dd(\Ibexa\AdminUi\Config::get());
Validator Debugging
validateInput(event) {
const result = { isError: true, errorMessage: 'Debug: Validation failed' };
console.log('Validation result:', result);
return result;
}
RichText Editor
window.ibexa.RichTextEditorConfig (v5.0.7+).window.ibexa.RichTextEditorConfig.plugins = [
'customPlugin',
...window.ibexa.RichTextEditorConfig.plugins,
];
Content Tree
ez-content-tree:
window.ibexa.ContentTree = window.ibexa.ContentTree.extend({
initialize: function() {
this._super();
console.log('Custom content tree initialized');
},
});
Field Type UI
resources/views/vendor/ibexa/).API Extensions
$router->get('/custom-endpoint', [CustomController::class, 'handle']);
How can I help you explore Laravel packages today?