Manual Installation

1. Install the Plugin via Composer

composer require sylius/cms-plugin

2. Enable the Bundle

# config/bundles.php

return [
    ...
    Sylius\CmsPlugin\SyliusCmsPlugin::class  => ['all' => true],
];

3. Import Configuration

# config/packages/_sylius.yaml

imports:
    ...
    - { resource: "@SyliusCmsPlugin/config/config.yaml" }

4. Import routes

# config/routes.yaml

...
sylius_cms:
    resource: "@SyliusCmsPlugin/config/routes.yaml"

5. Import plugin assets

// assets/admin/entrypoint.js

...
import '@vendor/sylius/cms-plugin/assets/admin/entrypoint'
// assets/shop/entrypoint.js

...
import '@vendor/sylius/cms-plugin/assets/shop/entrypoint'

6. Install assets

bin/console assets:install

7. Install Required JavaScript Packages

The CMS plugin uses trix for rich text editing and swiper for image galleries.

Run the following commands:

yarn add trix@^2.0.0 swiper@^11.2.6 @sylius-cms-plugin/admin@file:vendor/sylius/cms-plugin/assets/admin

And add the following JS controller:

// controllers.json
{
   "@sylius-cms-plugin/admin": {
      "preview": {
         "enabled": true,
         "fetch": "lazy"
      }
   }
}

Then compile the frontend assets:

yarn encore dev # or yarn encore prod

8. Run Doctrine Migrations

The plugin comes with database changes. Run:

bin/console doctrine:migrations:migrate # add `-e prod` for production

9. Clear the Cache

Finally, clear the Symfony cache to ensure changes are applied:

bin/console cache:clear

Installation Complete!

You can now manage CMS content through the Sylius Admin Panel under the new "CMS" section.

Last updated

Was this helpful?