fabz29 / cms-bundle
Fabz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.2
- doctrine/orm: ^2.5
- kms/froala-editor-bundle: ^2.8
- symfony/framework-bundle: ^4.0
This package is auto-updated.
Last update: 2025-02-24 03:11:37 UTC
README
Fbaz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface
Require
####kms/froala-editor-bundle
require kms/froala-editor-bundle
####Configuration froala editor
// app/config.yml kms_froala_editor: language: "fr" serialNumber: "XXXX-XXXX-XXXX" includeJQuery: false includeCodeMirror: false includeFontAwesome: true includeJS: true includeCSS: true imageUploadFolder: "/froala" # Disable autosave saveInterval: 0 pluginsDisabled: ['spellChecker'] imageDefaultWidth: 0 htmlDoNotWrapTags: ['img'] # do not add <p> tag automatically htmlUntouched: true
####Override the vendor Unfortunately, in the case you use several editor. You can't load fraola editor because it use an ID for select the DOM element and Symfony doesn't allow to customize the id in form element and the bundle doesn't allow to configure this element. So you have to override the template in the javascript with that
// vendor\kms\froala-editor-bundle\Resources\views\Form\froala_widget.html.twig
{# add the class .froala-editor #}
$( document ).ready( function () { $( ".froala-editor" ).froalaEditor({
Also use AJAX to offset this issue doesn't work because of too many ajax request !
Installation
####Step 1 :
require fabz29/cms-bundle
Step 2 : Add the bundle to your AppKernel.php
// config/AppKernel.php Fabz29\CmsBundle\Fabz29CmsBundle::class => ['all' => true],
Step 3 : Configure the bundle
// config/packages/fabz29_cms.yaml parameters: fabz29_cms: roles_allowed: ['ROLE_ADMIN']
// config/packages/routing.yml fabz29_cms: resource: "@Fabz29CmsBundle/Controller/" type: annotation
Step 4 : Enable manager in Twig
// config/services.yml twig: globals: block_manager: '@fabz29_cms.block.manager'
// config/services.yml Fabz29\CmsBundle\Manager\BlockManager: arguments: $params: '%fabz29_cms%'
How to use it
-
in your database at fabz29_cms_block table : Add the html in rich_content field in the fabz29_cms_block table in your data base and set the key_name field
-
in your twig template where the fuc* you want :
{{ block_manager.render('%your_key_name%')|raw }}
TODO
- Integrate froala into the bundle
- Add some tests (with
,
- optimize the assets (css, js) (today the assets are duplicated by the number of manager call by)
License
The bundle is developped by Fabien Zanetti and can be used only by himself. Copyright Fabien Zanetti. All Rights reserved