pm4life/cmsinstaller 问题修复 & 功能扩展

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

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

pm4life/cmsinstaller

Composer 安装命令:

composer require pm4life/cmsinstaller

包简介

Magento 2 utility module for migrating/managing cms pages and block data from local environment to remote

README 文档

README

Why? Because why not.

Usually when developing new or maintaining project there is a need for managing cms content. This extension provides an option to export cms content to a .html which can be added to project repository and moved easily from local to development or production environment. At least that's the general idea, could be totally wrong here, who knows, who cares.

Installation:

Download package from git or install it via composer with:

composer require pm4life/cmsinstaller
php bin/magento setup:upgrade

Next, enable module either via console command:

php bin/magento config:set cms/installer/is_enabled 1

or by settings in admin: Admin > Stores > Configuration > General > Content Management > Cms Content Installer

Screenshot from 2022-05-03 10-03-20

Configuration

There are two options for cms templates, they can either be placed within app/design/frontend/cms_install directory, or within certain allowed modules, this is controlled by admin setting, by default when extension is installed it is set to use app/design/frontend/cms_install directory as template base.

By switching Install Template Base to Allowed Module(s) Directory you have option to select any enabled module from app/code space

Screenshot from 2022-05-03 10-10-19

The idea is to present options for developer to choose if for any reason it is more convenient to have them placed all at one location per project, or alternatively have templates separated per module within local space.

Usage

Template preparation and export

After editing on cms page or block is completed in local environment, these can be exported to make them available for moving from environment.

To create template exports there are two ways, first one with console command:

php bin/magento cms:installer:export --type block --identifier 'catalog_events_lister,new_block_file'

Where two parameters are passed --type represents type of entity that is being exported, and --identifier represents unique identifiers of given page/cms block.

If command is called without parameters it will export all available cms blocks and pages.

Besides this way, when application is in developer or default mode, a button is available in admin panel on cms page and block forms, which generates template export that can be placed in apropriate filesystem location depending on configuration settings from above.

Screenshot from 2022-05-03 10-45-12

Installing changes from templates to system

To apply changes from template files on remote environment run:

php bin/magento cms:installer:apply

Changes to template files are tracked, so if you add changes to template file and run cms:installer:apply command, that will result in given block or page being updated with those changes.

Additional features

You can also use this console command to run regeneration of all active cms page url rewrites Please take into account any customizations that you have on your store as this is not something that should be done on a regular basis.

php bin/magento cms:installer:rebuild-url-rewrites

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固