Download the PHP package rocketweb/module-cms-import-export without Composer
On this page you can find all versions of the php package rocketweb/module-cms-import-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rocketweb/module-cms-import-export
More information about rocketweb/module-cms-import-export
Files in rocketweb/module-cms-import-export
Package module-cms-import-export
Short Description CMS import and export CLI command extension that allows syncing CMS blocks & pages between environments
License OSL-3.0 AFL-3.0
Informations about the package module-cms-import-export
CMS Import/Export Tool
A tool to manage CMS content (both blocks & pages) being imported/exported between environments using the repository. This tool comes handy for build and maintenance projects.
Ideas for using this:
- allowing FED team to create a CMS block/page in admin but then modify the HTML content using proper IDEs that allow auto-complete & code-styling
- allowing simpler deployments since there is no manual copy/paste of CMS data needed
- allowing the client to modify staging content and having it ready for deployment
- having an easy way to sync up production env to staging/dev/local by exporting on production and importing on staging/dev/local
Installation
Using composer:
Then enable module:
Once the tool is installed, we have two workflows, depending on what we are trying to do.
Export
Usage:
As you can see from the options, we need to define:
- type - which can be CMS block, CMS page or both - required
- identifier - either a CMS block or CMS page identifier - optional
With the combination of these two, we can export:
- all CMS content (using --type=all)
- all CMS pages (using --type=page)
- all CMS blocks (using --type=block)
- specific CMS page or pages (using --type=page --identifier=about-us.html,no-route)
- specific CMS block or blocks (using --type=block --identifier=who-are-we,homepage-carousel)
CMS Page identifier is Url Key! Because of that, it can have .html suffix - it depends on what is set in the Magento Admin CMS Edit Page. Use the actual value from CMS Edit Page - Url Key!If the CMS Page Url Key has .html suffix, then the file %%IDENTIFIER%% will be: url_key_html.html (but for export or import, you still use the value from Url Key)
Once you execute the command, you will get the following folder structure:
You can modify the HTML directly in your editor which should give you more flexibility.
When you are done, commit the files (html & json) to the repository.
Import
This command works by using files in var/sync_cms_data/cms/
path. As you can see from the options, we need to define:
- type - which can be CMS block or CMS page - required
- identifier - either a CMS block or CMS page identifier - optional There are optional parameters:
- importAll - when identifiers not specified we'll import all blocks or pages
- store - store code (like default) to import block(s)/pages(s) only for specific store With the combination of these two, we can import:
- all CMS pages (using --type=page and importAll)
- all CMS blocks (using --type=block and importAll)
- specific CMS page or pages (using --type=page --identifier=about-us,homepage-new)
- specific CMS block or blocks (using --type=block --identifier=who-are-we,homepage-carousel)
- specific CMS page by store (using --type=page --identifier=about-us-default --store=default)
Once you execute the command, the content will be created/updated in Magento Admin.
By executing
php bin/magento cache:flush
you should be able to see the updated CMS content on frontend also!