ubermanu / magento2-static-cms
此包已被 弃用 并不再维护。未建议替代包。
Magento 2 静态页面和块创建工具
v1.0.6
2022-03-11 17:54 UTC
Requires
- magento/module-cms: >=100 <=104
- mnapoli/front-yaml: ^1.8
README
Magento 2 静态页面和块创建工具。
安装
composer require ubermanu/magento2-static-cms
格式
文件包含 2 部分:标题和内容。
页面
---
is_active: 1
identifier: home
---
<p>An updated home page.</p>
块
---
is_active: 1
title: My Block
identifier: block-1
---
<p>This is the content of a block.</p>
使用
导入包含静态内容的页面
php bin/magento cms:static:import --type page <file>
FrontMatter
文件的 FrontMatter 部分是可选的。
但推荐使用它来设置模型属性。
---
is_active: 1
title: Home page
content_heading: Home Page
identifier: home
page_layout: 1column
---
<p>CMS homepage content goes here.</p>
导入目录
可以使用 xargs,记得按类型分割您的文件。
find <your-dir> -type f -print0 | xargs -l -0 php bin/magento cms:static:import --type page