Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use CKEditor with Symfony4 #329

Open
VoodooPrograms opened this issue Dec 2, 2017 · 19 comments
Open

Allow to use CKEditor with Symfony4 #329

VoodooPrograms opened this issue Dec 2, 2017 · 19 comments

Comments

@VoodooPrograms
Copy link

When authors will make CKEditor work fine with newest Symfony 4? I was trying to upgrade my project from 3.4 to 4.0, when that problem appears.
Problem 1
- egeloen/ckeditor-bundle 6.0.1 requires symfony/framework-bundle ^2.7|^3.0 -> satisfiable by symfony/framework-bundle[2.7.x-dev, 2.8.x-dev, 3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, v2.7.0, v2.7.0-BETA1, v2.7.0-BETA2, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.24, v2.7.25, v2.7.26, v2.7.27, v2.7.28, v2.7.29, v2.7.3, v2.7.30, v2.7.31, v2.7.32, v2.7.33, v2.7.34, v2.7.35, v2.7.36, v2.7.37, v2.7.38, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.0-BETA1, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9, v3.0.0, v3.0.0-BETA1, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.0-BETA1, v3.1.0-RC1, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.0-BETA1, v3.2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.0-BETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2] but these conflict with your requirements or minimum-stability.
- egeloen/ckeditor-bundle 6.0.0 requires symfony/framework-bundle ^2.7|^3.0 -> satisfiable by symfony/framework-bundle[2.7.x-dev, 2.8.x-dev, 3.0.x-dev, 3.1.x-dev, 3.2.x-dev, 3.3.x-dev, 3.4.x-dev, v2.7.0, v2.7.0-BETA1, v2.7.0-BETA2, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.23, v2.7.24, v2.7.25, v2.7.26, v2.7.27, v2.7.28, v2.7.29, v2.7.3, v2.7.30, v2.7.31, v2.7.32, v2.7.33, v2.7.34, v2.7.35, v2.7.36, v2.7.37, v2.7.38, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.0-BETA1, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.16, v2.8.17, v2.8.18, v2.8.19, v2.8.2, v2.8.20, v2.8.21, v2.8.22, v2.8.23, v2.8.24, v2.8.25, v2.8.26, v2.8.27, v2.8.28, v2.8.29, v2.8.3, v2.8.30, v2.8.31, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9, v3.0.0, v3.0.0-BETA1, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.0-BETA1, v3.1.0-RC1, v3.1.1, v3.1.10, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.2.0, v3.2.0-BETA1, v3.2.0-RC1, v3.2.0-RC2, v3.2.1, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.3.0, v3.3.0-BETA1, v3.3.0-RC1, v3.3.1, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2] but these conflict with your requirements or minimum-stability.
- Installation request for egeloen/ckeditor-bundle ^6.0 -> satisfiable by egeloen/ckeditor-bundle[6.0.0, 6.0.1].

@Muspi
Copy link

Muspi commented Dec 19, 2017

Hey, following this with attention :)

@Paktusin
Copy link

same problem

@Muspi
Copy link

Muspi commented Dec 26, 2017

My solution: use ckeditor natively in my app ;)

@jdutheil
Copy link

Juste require it with "@dev".. But there's still others issues after that, like "textarea" type.. ;/

@JellyBellyDev
Copy link

I'm interested too!

@SamuelSSalazar
Copy link

SamuelSSalazar commented Jan 9, 2018

While they release the bundle with Symfony 4 support you can use CKEditor 5 natively. Here is how i did it for easy admin textarea fields:

  1. Download the library
    from https://docs.ckeditor.com/ckeditor5/latest/builds/guides/integration/installation.html#Zip-download and put them into your public dir.

  2. In config/packages/easy_admin/design.yml add the files and a custom js file:

         js:
             - '/ckeditor5/ckeditor.js.map'
             - '/ckeditor5/ckeditor.js'
             - '/ckeditor5/mycustom.js'
    
  3. In the entity.yml add css_class to the property:

    form:
          - { property: 'myTextProp', css_class: 'awesome-ckeditor', type: 'textarea' }
    
  4. Finally in your custom js file add this code to initialize the editors:

     $(document).ready(function () {
         
             document.querySelectorAll( '.awesome-ckeditor textarea' )
                 .forEach(function(el){
                     el.removeAttribute('required');
                     ClassicEditor
                         .create( el )
                         .then( function (editor) {
                             console.log( editor );
                             var div = el.parentNode.querySelector('.ck-editor__editable');
                             div.style.backgroundColor = 'white'; 
                             div.style.minHeight = '300px';
                         } )
                         .catch( function (error) {
                             console.error( error );
                         } );
                 });
    
         });
    

Hope it helps for a temporal solution.
I´m looking forward to the next release of this bundle.

@rbrlortie
Copy link

@SamuelSSalazar's solution works great.

Make sure your css_class is the same in your custom file and on entity's form input.

I had to put my JS inclusions under easy_admin.yaml under:

easy_admin:
    design:
      assets:
        js:
          - 'ckeditor5/ckeditor.js.map'
          - 'ckeditor5/ckeditor.js'
          - 'ckeditor5/mycustom.js'

@jlemale
Copy link

jlemale commented Jan 24, 2018

There are some PR about it but @egeloen has no time to review them. :/

Dear #PHP and #Symfony community, still nobody intersted to take the lead of the #Ivory libraries & bundles? (no time for them...) See
https://twitter.com/egeloen/status/949356450962399235

@cybernet
Copy link

so no one seems to care ...

@laminr
Copy link

laminr commented Jan 25, 2018

I do, but I don't have the current knowledge to handle it (not yet)

@szymach
Copy link

szymach commented Jan 27, 2018

There is an issue with SensioDistributionBundle - it is not and will not be compatibile with Symfony 4, so until it is required in tests, they will not actually test all components in the 4.x version. It will either have to be removed or replaced.

@szymach
Copy link

szymach commented Feb 5, 2018

If you are really hard pressed to use this bundle with Symfony 4, my organization has made a fork that uses the #342 to allow it. You can find it on packagist.

Note that this is not a fork intended for any new features, though we may accept some bug fixes PR if someone bothers to submit to us. Use it as a substitute until a new maintainer for this bundles comes up.

@crayner
Copy link

crayner commented Feb 7, 2018

Have a full Symfony 4 integration of CKEditor. Currently waiting for flex recipe approval, but it works. See on packagist.

@vikas-srivastava
Copy link

@crayner I tried it but @EasyAdminBundle heavily relying on this module for CKEditor field type

@jacquesndl
Copy link

@vikas-srivastava

In the EasyAdmin cfg, you can write

- { property: 'content', type: 'Hillrange\CKEditor\Form\CKEditorType' }

instead of

- { property: 'content', type: 'ckeditor' }

I hope it helped you.

@proArtex
Copy link

proArtex commented May 21, 2018

FOS took this bundle over:
https://github.com/FriendsOfSymfony/FOSCKEditorBundle

@TheRatG
Copy link

TheRatG commented Jun 7, 2018

FOSCKEditorBundle

- { property: 'content', type: 'FOS\CKEditorBundle\Form\Type\CKEditorType' }

@pierrealexaline
Copy link

Then which version ? the official or forked ? Ivory or not ???? what the conclusion about this ? I search to use ckeditor with easy_admin and symfony 4 ...Thx

@xabbuh
Copy link

xabbuh commented Dec 12, 2018

As mentioned above FOSCKEditorBundle is the bundle to use now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests