b2c-business-manager-extensions by salesforcecommercecloud/b2c-developer-tooling
npx skills add https://github.com/salesforcecommercecloud/b2c-developer-tooling --skill b2c-business-manager-extensions本技能将指导您创建 Business Manager (BM) 扩展插件,以自定义管理界面。
BM 扩展允许您向 Business Manager 添加自定义功能:
| 扩展类型 | 用途 |
|---|---|
| 菜单项 | 添加顶级菜单部分 |
| 菜单操作 | 在菜单下添加功能链接 |
| 对话框操作 | 向现有 BM 页面添加按钮 |
| 表单扩展 | 向现有表单添加字段 |
/bm_my_extension
/cartridge
bm_extensions.xml # 扩展定义(必需)
/controllers
MyExtension.js # 菜单操作的控制器
/templates
/default
/extensions
mypage.isml # 自定义 BM 页面
/static
/default
/icons
my-icon.gif # 菜单图标
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
<?xml version="1.0" encoding="UTF-8"?>
<extensions xmlns="http://www.demandware.com/xml/extensibility/2013-04-24">
<!-- 菜单项:在导航中创建部分 -->
<menuitem id="my-tools" name="label.menu.mytools"
site="false" position="10">
<icon path="icons/my-icon.gif"/>
</menuitem>
<!-- 菜单操作:在菜单项下创建链接 -->
<menuaction id="my-dashboard" menupath="my-tools"
name="label.action.dashboard">
<exec pipeline="MyExtension" node="Dashboard"/>
<sub-pipelines>
<pipeline name="MyExtension"/>
</sub-pipelines>
</menuaction>
</extensions>
创建顶级导航部分:
<menuitem id="custom-tools"
name="label.menu.customtools"
site="false"
position="10">
<description>自定义管理工具</description>
<icon path="icons/tools-icon.gif"/>
</menuitem>
| 属性 | 必需 | 描述 |
|---|---|---|
id | 是 | 唯一标识符 |
name | 是 | 显示名称的资源键 |
site | 否 | true = 站点菜单,false = 管理菜单(默认:true) |
position | 否 | 排序顺序(数值越大,在列表中位置越高) |
在菜单项下添加功能页面:
<menuaction id="product-export"
menupath="custom-tools"
name="label.action.productexport">
<description>将产品导出为 CSV</description>
<exec pipeline="ProductExport" node="Start"/>
<sub-pipelines>
<pipeline name="ProductExport"/>
</sub-pipelines>
<icon path="icons/export-icon.gif"/>
</menuaction>
| 属性 | 必需 | 描述 |
|---|---|---|
id | 是 | 唯一标识符 |
menupath | 否 | 父菜单项 ID |
name | 是 | 显示名称的资源键 |
注意: 对于控制器,使用 pipeline="ControllerName" 和 node="ActionName"。
向现有 BM 页面添加按钮:
<dialogaction id="order-export-btn"
menuaction-ref="order-search"
xp-ref="OrderPage-OrderDetails">
<exec pipeline="OrderExport" node="Export"/>
<icon path="icons/export.gif"/>
<parameters>
<parameter name="OrderNo"/>
</parameters>
</dialogaction>
| 属性 | 必需 | 描述 |
|---|---|---|
id | 是 | 唯一标识符 |
menuaction-ref | 是 | 父菜单操作 ID |
xp-ref | 是 | 扩展点 ID |
常见扩展点:OrderPage-OrderDetails、ProductPage-Details、CustomerPage-Profile
向现有 BM 表单添加字段:
<formextension id="order-search-extension">
<valueinput type="string" name="customOrderField">
<label xml:lang="x-default">自定义字段</label>
<label xml:lang="de">Benutzerdefiniertes Feld</label>
</valueinput>
<valueinput type="string" name="exportStatus">
<label xml:lang="x-default">导出状态</label>
<option>待处理</option>
<option>已导出</option>
<option>失败</option>
</valueinput>
</formextension>
'use strict';
var ISML = require('dw/template/ISML');
var URLUtils = require('dw/web/URLUtils');
exports.Dashboard = function () {
ISML.renderTemplate('extensions/dashboard', {
title: '我的仪表板',
data: getReportData()
});
};
exports.Dashboard.public = true;
exports.ProcessAction = function () {
var params = request.httpParameterMap;
var itemId = params.itemId.stringValue;
// 处理操作
var result = processItem(itemId);
// 重定向返回或显示结果
response.redirect(URLUtils.url('MyExtension-Dashboard', 'result', result));
};
exports.ProcessAction.public = true;
<!DOCTYPE html>
<html>
<head>
<title>${pdict.title}</title>
<link rel="stylesheet" href="${URLUtils.staticURL('/css/bm-custom.css')}"/>
</head>
<body>
<div class="bm-content">
<h1>${pdict.title}</h1>
<table class="bm-table">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<isloop items="${pdict.data}" var="item">
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
<td>
<a href="${URLUtils.url('MyExtension-ProcessAction', 'itemId', item.id)}">
处理
</a>
</td>
</tr>
</isloop>
</tbody>
</table>
</div>
</body>
</html>
为标签添加资源包:
templates/resources/bm_extensions.properties:
label.menu.customtools=自定义工具
label.action.dashboard=仪表板
label.action.productexport=产品导出
templates/resources/bm_extensions_de.properties:
label.menu.customtools=Benutzerdefinierte Werkzeuge
label.action.dashboard=Instrumententafel
label.action.productexport=Produktexport
将插件添加到 Business Manager 站点的插件路径:
向角色授予权限:
每周安装数
71
代码库
GitHub 星标数
34
首次出现
2026年2月17日
安全审计
安装于
github-copilot65
codex62
cursor62
opencode61
amp60
kimi-cli60
This skill guides you through creating Business Manager (BM) extension cartridges to customize the admin interface.
BM extensions allow you to add custom functionality to Business Manager:
| Extension Type | Purpose |
|---|---|
| Menu Items | Add top-level menu sections |
| Menu Actions | Add functional links under menus |
| Dialog Actions | Add buttons to existing BM pages |
| Form Extensions | Add fields to existing forms |
/bm_my_extension
/cartridge
bm_extensions.xml # Extension definitions (required)
/controllers
MyExtension.js # Controller for menu actions
/templates
/default
/extensions
mypage.isml # Custom BM pages
/static
/default
/icons
my-icon.gif # Menu icons
<?xml version="1.0" encoding="UTF-8"?>
<extensions xmlns="http://www.demandware.com/xml/extensibility/2013-04-24">
<!-- Menu Item: Creates section in navigation -->
<menuitem id="my-tools" name="label.menu.mytools"
site="false" position="10">
<icon path="icons/my-icon.gif"/>
</menuitem>
<!-- Menu Action: Creates link under menu item -->
<menuaction id="my-dashboard" menupath="my-tools"
name="label.action.dashboard">
<exec pipeline="MyExtension" node="Dashboard"/>
<sub-pipelines>
<pipeline name="MyExtension"/>
</sub-pipelines>
</menuaction>
</extensions>
Create top-level navigation sections:
<menuitem id="custom-tools"
name="label.menu.customtools"
site="false"
position="10">
<description>Custom administration tools</description>
<icon path="icons/tools-icon.gif"/>
</menuitem>
| Attribute | Required | Description |
|---|---|---|
id | Yes | Unique identifier |
name | Yes | Resource key for display name |
site | No | true = Site menu, false = Admin menu (default: true) |
position | No | Sort order (higher = higher in list) |
Add functional pages under menu items:
<menuaction id="product-export"
menupath="custom-tools"
name="label.action.productexport">
<description>Export products to CSV</description>
<exec pipeline="ProductExport" node="Start"/>
<sub-pipelines>
<pipeline name="ProductExport"/>
</sub-pipelines>
<icon path="icons/export-icon.gif"/>
</menuaction>
| Attribute | Required | Description |
|---|---|---|
id | Yes | Unique identifier |
menupath | No | Parent menu item ID |
name | Yes | Resource key for display name |
Note: For controllers, use pipeline="ControllerName" and node="ActionName".
Add buttons to existing BM pages:
<dialogaction id="order-export-btn"
menuaction-ref="order-search"
xp-ref="OrderPage-OrderDetails">
<exec pipeline="OrderExport" node="Export"/>
<icon path="icons/export.gif"/>
<parameters>
<parameter name="OrderNo"/>
</parameters>
</dialogaction>
| Attribute | Required | Description |
|---|---|---|
id | Yes | Unique identifier |
menuaction-ref | Yes | Parent menu action ID |
xp-ref | Yes | Extension point ID |
Common extension points: OrderPage-OrderDetails, ProductPage-Details, CustomerPage-Profile
Add fields to existing BM forms:
<formextension id="order-search-extension">
<valueinput type="string" name="customOrderField">
<label xml:lang="x-default">Custom Field</label>
<label xml:lang="de">Benutzerdefiniertes Feld</label>
</valueinput>
<valueinput type="string" name="exportStatus">
<label xml:lang="x-default">Export Status</label>
<option>Pending</option>
<option>Exported</option>
<option>Failed</option>
</valueinput>
</formextension>
'use strict';
var ISML = require('dw/template/ISML');
var URLUtils = require('dw/web/URLUtils');
exports.Dashboard = function () {
ISML.renderTemplate('extensions/dashboard', {
title: 'My Dashboard',
data: getReportData()
});
};
exports.Dashboard.public = true;
exports.ProcessAction = function () {
var params = request.httpParameterMap;
var itemId = params.itemId.stringValue;
// Process the action
var result = processItem(itemId);
// Redirect back or show result
response.redirect(URLUtils.url('MyExtension-Dashboard', 'result', result));
};
exports.ProcessAction.public = true;
<!DOCTYPE html>
<html>
<head>
<title>${pdict.title}</title>
<link rel="stylesheet" href="${URLUtils.staticURL('/css/bm-custom.css')}"/>
</head>
<body>
<div class="bm-content">
<h1>${pdict.title}</h1>
<table class="bm-table">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<isloop items="${pdict.data}" var="item">
<tr>
<td>${item.id}</td>
<td>${item.name}</td>
<td>
<a href="${URLUtils.url('MyExtension-ProcessAction', 'itemId', item.id)}">
Process
</a>
</td>
</tr>
</isloop>
</tbody>
</table>
</div>
</body>
</html>
Add resource bundles for labels:
templates/resources/bm_extensions.properties:
label.menu.customtools=Custom Tools
label.action.dashboard=Dashboard
label.action.productexport=Product Export
templates/resources/bm_extensions_de.properties:
label.menu.customtools=Benutzerdefinierte Werkzeuge
label.action.dashboard=Instrumententafel
label.action.productexport=Produktexport
Add cartridge to Business Manager site's cartridge path:
Grant permissions to roles:
Weekly Installs
71
Repository
GitHub Stars
34
First Seen
Feb 17, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot65
codex62
cursor62
opencode61
amp60
kimi-cli60
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
145,500 周安装