Panel Shell and Order Hooks
The twenty placement points of the panel shell, the dashboard and the order screens: the head, the body, the top menus and the order detail.
Overview
Two different scales meet here. The shell points run on every page of the panel: the head, the body and the top menus. The dashboard and order points belong to a single screen.
The difference is cost. A heavy file placed at a shell point slows the whole panel; a point tied to one screen concerns only that screen.
Reference
Adding a style to the panel
Appears in the head section of the panel, on every page. Link a stylesheet of your own here.
Hook::add('ui:admin.head.css', 10, function () {
// It runs on EVERY page: keep it light.
return '<link rel="stylesheet" href="' . Acme::assetUrl('panel.css') . '">';
});Adding a script to the panel
Appears in the panel footer, on every page. Despite its name the output sits at the end of the page, where scripts load.
Hook::add('ui:admin.head.js', 10, function () {
// A failure here can stop the panel's own scripts too.
return '<script src="' . Acme::assetUrl('panel.js') . '" defer></script>';
});The start of the body
Appears at the very start of the page body, on every page. It suits an announcement banner across the whole panel.
Hook::add('ui:admin.body.begin', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The end of the body
Appears at the very end of the page body. It is the right place for modals and hidden containers.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.body.end', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});An item in the create menu
Appears in the create menu on the top bar. Put a quick-create link of your own here.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.header.create_menu', 10, function () {
return '<li><a class="dropdown-item" href="/acme/new">Acme record</a></li>';
});An item in the help menu
Appears in the help menu on the top bar. It suits a link to your own documentation or support.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.header.help_menu', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The top of the dashboard
Appears at the very top of the dashboard, above the statistic cards.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.dashboard.top', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});After the statistic cards
Appears immediately after the statistic cards on the dashboard. The place to add a counter card of your own to the row.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.dashboard.statistics.after', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The bottom of the dashboard
Appears at the very end of the dashboard. The place to add a panel of your own.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.dashboard.bottom', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});A badge or button in the order title
Appears in the title row of the order detail.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_detail.header_actions', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The top of the order detail
Appears above the order content. The place to show a warning that depends on the status.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_detail.top', 10,
function ($order, $order_id, $order_status) {
if ($order_status !== 'waiting') return null;
return '<div class="alert alert-info">Acme onayi bekleniyor</div>';
});Adding an operation to the order items
Appears in the operation area of the order items. Two flags beside you say which operation makes sense.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_detail.item_actions', 10,
function ($order, $has_pending_items, $has_module) {
// Modulsuz siparişte uzak islem butonu bosa calisir.
if (!$has_pending_items || !$has_module) return null;
return '<button class="btn btn-sm" onclick="acmeProvision()">Acme</button>';
});The very bottom of the order page
Appears at the very end of the page.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_detail.bottom', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The order list toolbar
Appears in the toolbar of the order list.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_list.toolbar', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});Above the table on the order list
Appears immediately above the order table.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_list.before_table', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});Above the order creation form
Appears above the manual order form.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_create.before_content', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});Below the order creation form
Appears below the same form.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.order_create.bottom', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The top of the domain pricing screen
Appears above the extension price table.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.domain_pricing.top', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The bottom of the domain pricing screen
Appears below the extension price table.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.domain_pricing.bottom', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});The document list toolbar
Appears in the toolbar of the extension document requirement list.
null and false are skipped, so return null when you have nothing to add. The output enters the page unescaped — clean anything coming from outside yourself.Hook::add('ui:admin.domain_doc_list.toolbar', 10, function () {
return '<div class="alert alert-info">Acme</div>';
});Pitfalls
The style and script points are not limited to one screen: whatever page an administrator opens, your output goes into it. A heavy file, or a script calling an outside service on every load, slows the whole panel. If what you add belongs to one screen, use that screen’s own point.
Code you add at the end of the page runs beside the panel’s own. An uncaught error halts script execution in the browser: what goes unresponsive is not your panel but the screen the administrator is using. Wrap your code in your own error handling.
Related Articles
- Management Panel Hooks
- Order Hooks
- Panel Analytics Hooks
Merci pour votre retour !
Notre équipe d'assistance est disponible 24h/24 pour tout ce que vous ne trouvez pas ci-dessus.