Open VoodooPrograms opened 6 years ago
Hey, following this with attention :)
same problem
My solution: use ckeditor natively in my app ;)
Juste require it with "@dev".. But there's still others issues after that, like "textarea" type.. ;/
I'm interested too!
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:
Download the library from https://docs.ckeditor.com/ckeditor5/latest/builds/guides/integration/installation.html#Zip-download and put them into your public dir.
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'
In the entity.yml add css_class to the property:
form:
- { property: 'myTextProp', css_class: 'awesome-ckeditor', type: 'textarea' }
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.
@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'
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
so no one seems to care ...
I do, but I don't have the current knowledge to handle it (not yet)
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.
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.
Have a full Symfony 4 integration of CKEditor. Currently waiting for flex recipe approval, but it works. See on packagist.
@crayner I tried it but @EasyAdminBundle heavily relying on this module for CKEditor field type
@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.
FOS took this bundle over: https://github.com/FriendsOfSymfony/FOSCKEditorBundle
- { property: 'content', type: 'FOS\CKEditorBundle\Form\Type\CKEditorType' }
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
As mentioned above FOSCKEditorBundle is the bundle to use now.
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