CMS feature integration

Edit on GitHub
You are browsing a previous version of the document. The latest version is 202212.0.
The current feature integration guide only adds the **CMS Multi-store** functionality to your project. Before following the steps described below, make sure that you have the basic feature configured in your project.
## Install Feature Core ### Prerequisites To start feature integration, overview, and install the necessary features:
Name Version
CMS 201903.0

1) Install the required modules using Composer

Run the following command(s) to install the required modules:

composer require spryker-feature/cms:"^201903.0" --update-with-dependencies

2) Set up Database Schema and Transfer Objects

Adjust the schema definition so that entity changes can trigger events.

Affected entity Triggered events
  • Entity.spy_cms_page_store.create
  • Entity.spy_cms_page_store.update
  • Entity.spy_cms_page_store.delete
<?xml version="1.0"?>
<database xmlns:xsi="" name="zed" xsi:noNamespaceSchemaLocation="" namespace="Orm\Zed\Cms\Persistence" package="src.Orm.Zed.Cms.Persistence">
	<table name="spy_cms_page_store">
		<behavior name="event">
			<parameter name="spy_cms_page_store_all" column="*"/>

Run the following commands to apply database changes and generate entity and transfer changes:

console transfer:generate
console propel:install
console transfer:generate
Make sure that the following changes were applied by checking your database:
Database entityTypeEvent
Make sure that the following changes were applied by checking your generated transfers:

3) Import data

Add CMS Page plugins in the correct order.

Plugin Specification Prerequisite Namespace
CmsPageStoreDataImportPlugin Associates a page with different stores.
  • CmsPageStoreDataImportPlugin must load after CmsPageDataImport
  • Navigation Import (if installed) must load after all CMS Page data importers.
namespace Pyz\Zed\DataImport;
use Spryker\Zed\CmsPageDataImport\Communication\Plugin\CmsPageStoreDataImportPlugin;
use Spryker\Zed\DataImport\DataImportDependencyProvider as SprykerDataImportDependencyProvider;
class DataImportDependencyProvider extends SprykerDataImportDependencyProvider
	* @return array
	protected function getDataImporterPlugins(): array
		return [
			new CmsPageStoreDataImportPlugin(),

Load CMS Page Multi-store Settings.


####CSV Description

Column Is Mandatory? Data Type Data Example Data Explanation
page_key Yes String imprint_page CMS Page page_key.
store_name Yes String DE Country Code for the store this page will be displayed for.
Verify installation by using data importers with the pages that are loaded into multiple stores.
`console data:import cms-page-store`
You should see store settings for pages in Zed are configured as specified in your CSV files.

4) Set up Behavior

Add the following plugins:

Plugin Specification Prerequisite Namespace
StoreRelationToggleFormTypePlugin Enables a list of toggleable stores. None Spryker\Zed\Store\Communication\Plugin\Form
namespace Pyz\Zed\CmsGui;
use Spryker\Zed\CmsGui\CmsGuiDependencyProvider as SprykerCmsGuiDependencyProvider;
use Spryker\Zed\Kernel\Communication\Form\FormTypeInterface;
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
class CmsGuiDependencyProvider extends SprykerCmsGuiDependencyProvider
	* @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
	protected function getStoreRelationFormTypePlugin(): FormTypeInterface
		return new StoreRelationToggleFormTypePlugin();

Editing CMS pages in Zed should show a toggle for all available stores.
Once you have finished the full integration of the feature, make sure that CMS Pages will only be available in their specific stores in Yves.