monsieurbiz / sylius-cms-page-plugin
This plugins allows you to add manage CMS pages using the Rich Editor
Installs: 90 849
Dependents: 1
Suggesters: 0
Security: 0
Stars: 39
Watchers: 7
Forks: 26
Open Issues: 1
Type:sylius-plugin
Requires
- php: ^8.2
- monsieurbiz/sylius-media-manager-plugin: ^2.0
- monsieurbiz/sylius-rich-editor-plugin: ^3.0
- sylius/sylius: ~2.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.16
- phpmd/phpmd: ^2.15
- phpspec/phpspec: ^7.0
- phpstan/phpstan: ^1.8.4
- phpstan/phpstan-doctrine: ^1.3.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^10.5
- 2.x-dev
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- dev-master / 1.1.x-dev
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-RC.16
- v1.0.0-RC.15
- v1.0.0-RC.14
- v1.0.0-RC.13
- v1.0.0-RC.12
- v1.0.0-RC.11
- v1.0.0-RC.10
- v1.0.0-RC.9
- v1.0.0-RC.8
- v1.0.0-RC.7
- v1.0.0-RC.6
- v1.0.0-RC.5
- v1.0.0-RC.4
- v1.0.0-RC.3
- v1.0.0-RC.2
- v1.0.0-RC.1
- dev-feature/add-pages-to-sitemap
- dev-feature/preview-page
This package is auto-updated.
Last update: 2025-05-26 06:59:25 UTC
README
Sylius CMS Pages
This plugins allows you to add manage CMS pages using the Rich Editor and the Media Manager.
If you want to know more about our editor, see the Rich Editor Plugin
If you want to know more about our editor, see the Media Manager Plugin
Compatibility
Sylius Version | PHP Version |
---|---|
2.0 | 8.2 - 8.3 |
âšī¸ For Sylius 1.x, see our 1.x branch and all 1.x releases.
Installation
If you want to use our recipes, you can configure your composer.json by running:
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
composer require monsieurbiz/sylius-cms-page-plugin
If you do not use the recipes :
Change your config/bundles.php
file to add the line for the plugin :
<?php return [ //.. MonsieurBiz\SyliusCmsPagePlugin\MonsieurBizSyliusCmsPagePlugin::class => ['all' => true], ];
Then create the config file in config/packages/monsieurbiz_sylius_cms_page_plugin.yaml
:
imports: - { resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/config.yaml" }
Finally import the routes in config/routes/monsieurbiz_sylius_cms_page_plugin.yaml
:
monsieurbiz_cms_page_admin: resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/routing/admin.yaml" prefix: /%sylius_admin.path_name% # Show page monsieurbiz_cms_page_show: path: /{_locale}/{slug} methods: [GET] requirements: slug: .+ _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ defaults: _controller: monsieurbiz_cms_page.controller.page::showAction _sylius: template: "@MonsieurBizSyliusCmsPagePlugin/shop/page/show.html.twig" repository: method: findOneEnabledAndPublishedBySlugAndChannelCode arguments: - $slug - "expr:service('sylius.context.locale').getLocaleCode()" - "expr:service('sylius.context.channel').getChannel().getCode()" - "expr:service('monsieurbiz.cms_page.datetime_provider').now()" condition: "not(context.getPathInfo() matches '`^%sylius.security.api_route%`') and context.checkPageSlug(request)"
Migrations
First, please run legacy-versioned migrations by using command :
bin/console doctrine:migrations:migrate
After migration, please create a new diff migration :
bin/console doctrine:migrations:diff
Then run it (if any) :
bin/console doctrine:migrations:migrate
Example of complete CMS Page
Admin grid
Admin form
Create custom elements
You can customize and create custom elements in your page.
In order to do that, you can check the Rich Editor custom element creation
SEO Friendly
You can define for every page the meta title, meta description, meta keywords and meta image.
Troubleshooting
Locale not found
We've added a new LocaleContext (LastChanceLocaleContext
) because the locale isn't set in the request when the
condition on the route is applied.
Therefore, if you still have an issue with multiple locales in your project, you may need to add another LocaleContext
in order to find out your locale. The system will take care of the rest.
Contributing
You can open an issue or a Pull Request if you want! đ
Thank you!