monsieurbiz / sylius-cms-block-plugin
Save rich editor contents in database and use it as UI Element
Installs: 1 506
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 5
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^8.2
- monsieurbiz/sylius-rich-editor-plugin: ^3.0
- sylius/sylius: ~2.0.0
Requires (Dev)
- behat/behat: ^3.6.1
- 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
README
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-block-plugin
If you do not use the recipes :
Change your config/bundles.php
file to add the line for the plugin :
<?php return [ //.. MonsieurBiz\SyliusCmsBlockPlugin\MonsieurBizSyliusCmsBlockPlugin::class => ['all' => true], ];
Then create the config file in config/packages/monsieurbiz_sylius_cms_block_plugin.yaml
:
imports: resource: '@MonsieurBizSyliusCmsBlockPlugin/Resources/config/config.yaml'
Finally import the routes in config/routes/monsieurbiz_sylius_cms_block_plugin.yaml
:
imports: resource: '@MonsieurBizSyliusCmsBlockPlugin/Resources/config/routes.yaml'
If you want to have the wireframe of block
element in the Rich Editor, copy the file :
cp vendor/monsieurbiz/sylius-cms-block-plugin/src/Resources/views/wireframe/block.svg.twig templates/bundles/MonsieurBizSyliusRichEditorPlugin/Wireframe/block.svg.twig
Migrations
First, please run legacy-versioned migrations by using command :
bin/console doctrine:migrations:migrate
Example
Admin list
Manage your block in admin
Admin form
Manage the content of your block, you can decide to disable or enable it to display it anywhere you used it.
Include it in your content
For example in your Homepage ou CMS Page,
by using block
element in your Rich Editor.
Displays in front
You can use it in multiple places, it will shown the same content everywhere.
If you disable the block, it will not be displayed anymore.
License
This plugin is under the MIT license. Please see the LICENSE file for more information.