b2c-content
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseB2C Content Skill
B2C 内容管理Skill
Use the CLI to export and list Page Designer content from Salesforce B2C Commerce content libraries.
b2cTip: Ifis not installed globally, useb2cinstead (e.g.,npx @salesforce/b2c-cli).npx @salesforce/b2c-cli content export homepage
使用 CLI从Salesforce B2C Commerce内容库中导出和列出Page Designer内容。
b2c提示: 如果未全局安装,请改用b2c(例如:npx @salesforce/b2c-cli)。npx @salesforce/b2c-cli content export homepage
Examples
示例
Export Pages
导出页面
bash
undefinedbash
undefinedexport a single page from a shared library
从共享库导出单个页面
b2c content export homepage --library SharedLibrary
b2c content export homepage --library SharedLibrary
export multiple pages
导出多个页面
b2c content export homepage about-us contact --library SharedLibrary
b2c content export homepage about-us contact --library SharedLibrary
export pages matching a regex pattern
导出匹配正则表达式模式的页面
b2c content export "hero-.*" --library SharedLibrary --regex
b2c content export "hero-.*" --library SharedLibrary --regex
export to a specific output directory
导出到指定的输出目录
b2c content export homepage --library SharedLibrary -o ./my-export
b2c content export homepage --library SharedLibrary -o ./my-export
export a specific component by ID
通过ID导出特定组件
b2c content export hero-banner --library SharedLibrary
b2c content export hero-banner --library SharedLibrary
export from a site-private library
从站点私有库导出
b2c content export homepage --library RefArch --site-library
b2c content export homepage --library RefArch --site-library
preview without downloading (dry run)
预览而不下载(试运行)
b2c content export homepage --library SharedLibrary --dry-run
b2c content export homepage --library SharedLibrary --dry-run
export with JSON output
以JSON格式导出
b2c content export homepage --library SharedLibrary --json
b2c content export homepage --library SharedLibrary --json
export from a local XML file (offline, no instance needed)
从本地XML文件导出(离线模式,无需连接实例)
b2c content export homepage --library SharedLibrary --library-file ./library.xml --offline
b2c content export homepage --library SharedLibrary --library-file ./library.xml --offline
filter pages by folder classification
按文件夹分类筛选页面
b2c content export homepage --library SharedLibrary --folder seasonal
b2c content export homepage --library SharedLibrary --folder seasonal
custom asset extraction paths
自定义资源提取路径
b2c content export homepage --library SharedLibrary -q "image.path" -q "video.url"
b2c content export homepage --library SharedLibrary -q "image.path" -q "video.url"
include orphan components in export
在导出中包含孤立组件
b2c content export homepage --library SharedLibrary --keep-orphans
undefinedb2c content export homepage --library SharedLibrary --keep-orphans
undefinedList Content
列出内容
bash
undefinedbash
undefinedlist all content in a library
列出库中的所有内容
b2c content list --library SharedLibrary
b2c content list --library SharedLibrary
list only pages
仅列出页面
b2c content list --library SharedLibrary --type page
b2c content list --library SharedLibrary --type page
list including components
列出内容并包含组件
b2c content list --library SharedLibrary --components
b2c content list --library SharedLibrary --components
show tree structure
显示树形结构
b2c content list --library SharedLibrary --tree
b2c content list --library SharedLibrary --tree
list from a site-private library
从站点私有库列出内容
b2c content list --library RefArch --site-library
b2c content list --library RefArch --site-library
list from a local XML file
从本地XML文件列出内容
b2c content list --library SharedLibrary --library-file ./library.xml
b2c content list --library SharedLibrary --library-file ./library.xml
JSON output
以JSON格式输出
b2c content list --library SharedLibrary --json
undefinedb2c content list --library SharedLibrary --json
undefinedConfiguration
配置
The flag can be configured in or so you don't need to pass it every time:
--librarydw.jsonpackage.jsonjson
// dw.json
{
"hostname": "my-sandbox.demandware.net",
"content-library": "SharedLibrary"
}json
// package.json
{
"b2c": {
"contentLibrary": "SharedLibrary"
}
}With a configured library, commands become shorter:
bash
b2c content export homepage
b2c content list --type page--librarydw.jsonpackage.jsonjson
// dw.json
{
"hostname": "my-sandbox.demandware.net",
"content-library": "SharedLibrary"
}json
// package.json
{
"b2c": {
"contentLibrary": "SharedLibrary"
}
}配置好库之后,命令会更简洁:
bash
b2c content export homepage
b2c content list --type pageMore Commands
更多命令
See for a full list of available commands and options in the topic.
b2c content --helpcontent查看获取主题下的所有可用命令和选项。
b2c content --helpcontentRelated Skills
相关技能
- - Site archive import/export operations
b2c-cli:b2c-site-import-export - - Low-level file operations on content libraries
b2c-cli:b2c-webdav - - Configuration and credential management
b2c-cli:b2c-config
- - 站点归档导入/导出操作
b2c-cli:b2c-site-import-export - - 内容库上的底层文件操作
b2c-cli:b2c-webdav - - 配置和凭据管理
b2c-cli:b2c-config