Skip to content

monsieurbiz/SyliusCmsPagePlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a8b0875 Â· Mar 4, 2025
Jan 21, 2025
Mar 4, 2025
Oct 30, 2023
Nov 9, 2020
Mar 4, 2025
Nov 3, 2021
Nov 9, 2020
Dec 22, 2021
Jul 4, 2024
Jan 21, 2025
Oct 30, 2021
Nov 16, 2020
Jan 21, 2025
Jan 21, 2025
Nov 9, 2020
Nov 10, 2020
Jan 21, 2025
Jun 3, 2024
Mar 24, 2020
Oct 30, 2021
Oct 30, 2021
Nov 9, 2020
Aug 27, 2024
Oct 30, 2021

Repository files navigation

Banner of Sylius CMS Pages plugin

Sylius CMS Pages

CMS Page Plugin license Tests Status Recipe Status Security Status

This plugins allows you to add manage CMS pages using the Rich Editor.

If you want to know more about our editor, see the Rich Editor Repository

Example of CMS page creation

Compatibility

Sylius Version PHP Version
1.12 8.1 - 8.2 - 8.3
1.13 8.1 - 8.2 - 8.3
1.14 8.1 - 8.2 - 8.3

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

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%

monsieurbiz_cms_page_shop:
    resource: "@MonsieurBizSyliusCmsPagePlugin/Resources/config/routing/shop.yaml"
    prefix: /{_locale}

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 form with preview

Admin full form

Front display

Front full display

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 and meta keywords.

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!