承接 space48/magento2-cms-content-setup 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

space48/magento2-cms-content-setup

Composer 安装命令:

composer require space48/magento2-cms-content-setup

包简介

Provides tooling for initial CMS content creation by FE developer using install scripts and fixtures

关键字:

README 文档

README

Magento2 module to simplify CMS content creation.

Purpose

This tool is designed to allow frontend developer easily install CMS Pages and Blocks skeletons with 'Lorem ipsum' or actual content at the early stage of the project.

Developer can create a content on local machine, then create a fixtures out of the database data generated by Page Builder or by WYSIWYG. Then add install scripts or data patches to install the data automatically on all CI environments and other developers local machines.

Installation

Via composer:

  • Add module:
composer config repositories.space48-magento2-cms-content-setup vcs git@github.com:Space48/magento2-cms-content-setup.git
composer require "space48/magento2-cms-content-setup:{module-version}"
  • Run setup:upgrade

Usage

  1. Install 'CmsContentSetup' module on your project
  2. Create a separate module for fixtures and install scripts (for ex. MyProject/CmsSetup)
  3. Create a html files containing your CMS Blocks or Pages code under 'fixtures' folder of your module.
  4. Create a Data Patch or install scripts in your module for installing Blocks and Pages.

Example Data Patch for CMS Block:

public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        \Space48\CmsContentSetup\Model\Setup\Blocks $blockSetup
) {
    $this->moduleDataSetup = $moduleDataSetup;
    $this->blockSetup = $blockSetup;
}

...

public function apply()
{
    $this->moduleDataSetup->startSetup();

    $this->blockSetup->install(
        [
            [
                'title' => 'Test Block',
                'identifier' => 'test_block',
                'file' => 'MyProject_CmsSetup::blocks/test/test_block.html', // starting from 'fixtures' folder
                'stores' => ['nl', 'fr'], // can be id or code
                'is_active' => true
            ]
        ]
    );

    $this->moduleDataSetup->endSetup();
}

Example Data Patch for CMS Page:

public function __construct(
    ModuleDataSetupInterface $moduleDataSetup,
    \Space48\CmsContentSetup\Model\Setup\Pages $pagesSetup
) {
    $this->moduleDataSetup = $moduleDataSetup;
    $this->pagesSetup = $pagesSetup;
}

...

public function apply()
{
    $this->moduleDataSetup->startSetup();

    $this->pagesSetup->install(
        [
            [
                'title' => 'Test Page',
                'page_layout' => '1column',
                'meta_keywords' => '',
                'meta_description' => '',
                'identifier' => 'test_page',
                'content_heading' => 'Content Heading',
                'layout_update_xml' => '',
                'url_key' => 'test_page',
                'stores' => ['de', 'fr'], // code or id
                'sort_order' => 0,
                'is_active' => true,
                'file' => 'MyProject_CmsSetup::pages/test_page.html', // starting from 'fixtures' folder
            ]
        ]
    );

    $this->moduleDataSetup->endSetup();
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固