ubermanu / magento2-static-cms
Tool for creating static pages and blocks for Magento 2
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Type:magento2-module
Requires
- magento/module-cms: >=100 <=104
- mnapoli/front-yaml: ^1.8
README
Tool for creating static pages and blocks for Magento 2.
Install
composer require ubermanu/magento2-static-cms
Format
The file contains 2 parts: header and content.
Page
---
is_active: 1
identifier: home
---
<p>An updated home page.</p>
Block
---
is_active: 1
title: My Block
identifier: block-1
---
<p>This is the content of a block.</p>
Usage
Import a page with static content:
php bin/magento cms:static:import --type page <file>
FrontMatter
The FrontMatter part of the file is optional.
But it's recommended to use it to set the model properties.
---
is_active: 1
title: Home page
content_heading: Home Page
identifier: home
page_layout: 1column
---
<p>CMS homepage content goes here.</p>
Import directories
It's possible using xargs, remember to split your files by type:
find <your-dir> -type f -print0 | xargs -l -0 php bin/magento cms:static:import --type page