do-it-well/magento2-module-cms-command 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

do-it-well/magento2-module-cms-command

Composer 安装命令:

composer require do-it-well/magento2-module-cms-command

包简介

CMS import/export commands for Magento2

README 文档

README

A Magento2 Module providing CMS-related command-line tools.

Installation

This module can be installed via composer and the Magento2 command-line tool. For example:

composer require do-it-well/magento2-module-cms-command
./bin/magento module:enable DIW_CmsCommand
./bin/magento setup:upgrade

Commands

  • cms:block:list list available CMS block IDs
  • cms:block:dump dump (as JSON) either all CMS block data, or (if specified) the CMS block data of a specific block_id
  • cms:block:load load (from a JSON object, or array of JSON objects), CMS block data
  • cms:page:list list available CMS page IDs
  • cms:page:dump dump (as JSON) either all CMS page data, or (if specified) the CMS page data of a specific page_id
  • cms:page:load load (from a JSON object, or array of JSON objects), CMS page data

What It Does

The cms:*:dump commands dump either a single model, or each of a collection of models, and directly output the result of $model->getData() as a JSON object to STDOUT.

The cms:*:load commands read a JSON object (or each object from a JSON array of objects). If a relevant *_id attribute is set within the JSON object, that object is loaded; otherwise, an empty model is created. In either case, the decoded JSON object is passed to $model->setData() directly, and the model is saved. ie: if the *_id field is not set, a new page/block will be created.

As should be obvious, this method of dumping / loading CMS data is very basic, and there are many situations in which these methods would not be appropriate or safe. No guarantees are made. You should perform both dumps and loads only with a complete understanding of the limitations of this implementation.

Examples

You can dump a specific page or block as a single json object to STDOUT, by identifier

$ bin/magento cms:page:dump home
{"page_id":"2","title":"My eCommerce Site","page_layout":...

...or by numeric id

$ bin/magento cms:page:dump 2
{"page_id":"2","title":"My eCommerce Site","page_layout":...

You can also dump all pages / blocks, as a json array of json objects, by omitting the id/identifier

$ bin/magento cms:page:dump
[
{"page_id":"1","title":"404 Not Found","page_layout":...},
{"page_id":"2","title":"My eCommerce Site","page_layout":...},
...

The same format can also be used to re-import a dumped page or block

$ bin/magento cms:page:dump home > home.json
... edit home.json ...
$ bin/magento cms:page:load < home.json

...or a list of multiple pages or blocks

$ bin/magento cms:page:dump > pages.json
... edit pages.json ...
$ bin/magento cms:page:load < pages.json

License

All module code within this repository is licensed under the MIT license. See the MIT-LICENSE.txt file for details.

Support

If you encounter any problems with this module, you may open an issue on GitHub at https://github.com/do-it-well/magento2-module-cms/issues

Premium support, assistance in module installation or configuration, or other development services, can be obtained by contacting Do It Well Limited

统计信息

  • 总下载量: 18.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固