2017 © Pedro Peláez
 

symfony-bundle cms-bundle

Fabz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface

image

fabz29/cms-bundle

Fabz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface

  • Friday, May 18, 2018
  • by Fabz29
  • Repository
  • 1 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Fbaz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface, (*1)

Require

kms/froala-editor-bundle

require kms/froala-editor-bundle

Configuration froala editor

``` yaml // app/config.yml, (*2)

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, (*3)

<, (*4)

p> tag automatically htmlUntouched: true, (*5)


####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 ``` twig // 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 !, (*6)

Installation

Step 1 :

require fabz29/cms-bundle

Step 2 : Add the bundle to your AppKernel.php

``` php // config/AppKernel.php, (*7)

Fabz29\CmsBundle\Fabz29CmsBundle::class => ['all' => true],, (*8)


#### Step 3 : Configure the bundle ``` yaml // config/packages/fabz29_cms.yaml parameters: fabz29_cms: roles_allowed: ['ROLE_ADMIN']

``` yaml // config/packages/routing.yml fabz29_cms: resource: "@Fabz29CmsBundle/Controller/" type: annotation, (*9)


#### Step 4 : Enable manager in Twig ``` yaml // config/services.yml twig: globals: block_manager: '@fabz29_cms.block.manager'

yaml // config/services.yml Fabz29\CmsBundle\Manager\BlockManager: arguments: $params: '%fabz29_cms%', (*10)

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, (*11)

  • in your twig template where the fuc* you want : twig {{ block_manager.render('%your_key_name%')|raw }}, (*12)

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, (*13)

The Versions

18/05 2018

dev-master

9999999-dev

Fabz29CmsBundle is a Symfony Bundle allows a typical user to modify their website directly from the front-end interface

  Sources   Download

proprietary

The Requires

 

fabz29 cms