Manual Installation
1. Install the Plugin via Composer
composer require sylius/cms-plugin2. 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:install7. 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/adminAnd 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 prod8. Run Doctrine Migrations
The plugin comes with database changes. Run:
bin/console doctrine:migrations:migrate # add `-e prod` for production9. Clear the Cache
Finally, clear the Symfony cache to ensure changes are applied:
bin/console cache:clearInstallation Complete!
You can now manage CMS content through the Sylius Admin Panel under the new "CMS" section.
Last updated
Was this helpful?
