egeloen / ivoryckeditorbundle Goto Github PK
View Code? Open in Web Editor NEWProvides a CKEditor integration for your Symfony project.
License: MIT License
Provides a CKEditor integration for your Symfony project.
License: MIT License
Hi i put config from integration maual - dont have any errors but dont see ckeditor in FMElfinderBundle. It should show when i click edit txt or .html file ? maybe i must configure somethink else ? please more info.
i have the same issue but dont understood how to make it workout.
Got 2.0 branch but keep getting the same error:
after those modifications on CKEditorType
The option "toolbar" does not exist
Nice Bundle ;)
is there any way to configure the content css of the ckeditor?
I mean use an external css file?
Using the way described in the following link:
http://ckeditor.com/blog/CKEditor_for_jQuery
I receive an error calling the method .ckeditor on an object (Uncaught TypeError: Object [object Object] has no method 'ckeditor' ).
Code:
function edit(obj)
{
var textarea = $("<.textarea></.textarea>");
textarea.attr('id', 'editor');
textarea.val(html);
textarea.appendTo(obj);
textarea.ckeditor();
}
(The dots are there to fix the not viewing raw html by github, they are not in the code)
I tried it in plain js too and it didn't work there either.
In your example to configure the color of the ui you use ui-color
but it doesn't work.
According to the CKEditor the parameter is uiColor
.
Documenation needs update for this.
The option "config" does not exist
500 Internal Server Error - CreationException
I'm facing this issue when I try to add config options like this :
$builder->add('field', 'ckeditor', array(
'config' => array(
'toolbar' => array(
array(
'name' => 'document',
'items' => array('Source', '-', 'Save', 'NewPage', 'DocProps', 'Preview', 'Print', '-', 'Templates'),
),
'/',
array(
'name' => 'basicstyles',
'items' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'),
),
),
'ui_color' => '#ffffff',
//...
),
));
Editor is working fine if i remove config options but it displays all the tools,Please help me
after commit db93af5
when i want to clear cache :
[Symfony\Component\DependencyInjection\Exception\InactiveScopeException] You cannot create a service ("ivory_ck_editor.helper.templating") of an inactive scope ("request").
Hello,
I'm having trouble getting the bundle to work since I updated some of my dependencies.
I am working with CKEditorBundle 2.1.5. I have to mention that the problem that I have is also happening when I tried CKEditorBundle 2.2.*.
When I try to display a ckeditor form type in my form, like this :
->add('description', 'ckeditor', array(
'label' => false
))
And then in my template :
...
{{ form_row(form.description) }}
...
The WYSIWYG displays well, but then the script tags that come after in the ckeditor.widget.html.twig are printed but are not interpreted (see the image).
I don't really know if this especially related to the bundle, but I had no problem until I updated my dependencies.
Does anybody see what could be the problem?
Tried to setup default Ck configuration in yml, as described in manual:
ivory_ck_editor:
default_config: my_config
configs:
my_config:
toolbar: full
I'm getting errors, because undefined variables: "Warning: Invalid argument supplied for foreach() in /egeloen/ckeditor-bundle/Ivory/CKEditorBundle/Resources/views/Form/ckeditor_widget.html.php" lines 15/19/23
I'm not planing to use plugins, templates, or need custom styles, so I expect default configuration to prepare those needed variables and work out of the box.
Hi there,
I have a strange problem ... Locally all works fine but when i deploy my app to live and include any smilies image i am having double escaping issue.
<img alt=\"kiss\" height=\"20\" src=\"http://zwooper.test.digitaleffect.co/bundles/digitalckeditor/plugins/smiley/images/kiss.gif\" title=\"kiss\" width=\"20\" />
Am I doing anything wrong? I looked up the database and this output is coming from the db...
\r\n lots of it everywhere.... And would be good to convert it to unix format \n
hi
i ded look for jonlil/JonlilCKFinderBundle, but it simce that is not stable solution : https://github.com/jonlil/JonlilCKFinderBundle/issues/7
and me i m not so good to take this project.
my question is how to easly integret this CKFINDER in my project ?
more oven i m just looking to have he filesManager (upload/download) i my web site, maybe there better solution?
thank if you can help.
hi
i want to know if there is possibility to get in easy way change the "Full Toolbar" to "Standard Toolbar" or "Simple Toolbar" as they propose in CKEditor website ?
( http://ckeditor.com/demo#toolbar )
what abort inline mode ?
thank
After updating sf2 and its bundles ckedtiro form type stopped working. Note i had to update CKEditorType class CKEditorType in order to avoid errors complaining about not implementing FormTypeInterface correctly.
That's the error i got after updating class CKEditorType:
Notice: Undefined index: toolbar in /home/sibok/public_html/SalleBcn/vendor/bundles/Ivory/CKEditorBundle/Form/Type/CKEditorType.php line 21
I modified class CKEditorType leaving it as:
setAttribute('toolbar', $options['toolbar']) ->setAttribute('ui_color', $options['ui_color']); } /** - {@inheritdoc} */ public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form) { $view ->setVar('toolbar', $form->getAttribute('toolbar')) ->setVar('ui_color', $form->getAttribute('ui_color')); } /** - {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'required' => false, 'toolbar' => array( array( 'name' => 'document', 'items' => array('Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates') ), array( 'name' => 'clipboard', 'items' => array('Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo') ), array( 'name' => 'editing', 'items' => array('Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt') ), array( 'name' => 'forms', 'items' => array('Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField') ), '/', array( 'name' => 'basicstyles', 'items' => array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat') ), array( 'name' => 'paragraph', 'items' => array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl') ), array( 'name' => 'links', 'items' => array('Link','Unlink','Anchor') ), array( 'name' => 'insert', 'items' => array('Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak') ), '/', array( 'name' => 'styles', 'items' => array('Styles','Format','Font','FontSize') ), array( 'name' => 'colors', 'items' => array('TextColor','BGColor') ), array( 'name' => 'tools', 'items' => array('Maximize', 'ShowBlocks','-','About') ) ), 'ui_color' => null )); $resolver->addAllowedValues(array('required' => array(false))); } /** - {@inheritdoc} */ public function getParent(array $options) { return 'textarea'; } /** - {@inheritdoc} */ public function getName() { return 'ckeditor'; } }All is fine but, when i create a sonata_type_collection like this:
//ProductAdmin.php
$formMapper
->add('languages', 'sonata_type_collection', array(
'by_reference' => false,
'label' => 'languages'
), array(
'edit' => 'inline',
'inline' => 'table'
)
)
//ProductLanguageAdmin.php
$languages = $this->getConfigurationPool()->getContainer()->get("esolving_page_core")->getLanguages();
foreach ($languages as $languageK => $language) {
$choiceLanguages[$languageK] = $language;
}
$formMapper
->with('general')
->add('language', 'choice', array(
'label' => 'language',
'choices' => $choiceLanguages))
->add('name', null, array('label' => 'name'))
->add('description', 'ckeditor', array(
'label' => 'description',
'config_name' => 'standard'
))
->end()
;
then in product append other table inline of languages, the first is fine, but then ckeditor is crushing, any help please?
Do we have any sort of plugin management is the intention to have all plugins there in the bundle to prevent overriding in src?
I guess I can download it and declare it in my child bundle but seems a bit 'not nite!' ?
When you create multiple forms of same type in one page, browser renders CKEditor at the place of first instance of the textarea of first form. because it searches for the id and the id is same for each form (Symfony2 gets data from datatype name).
Instead of calling replace function of ckeditor, it should be a solution to add a class attribute like this:
'attr'=>array('class'=>'ckeditor')
In addition these lines should be removed from ckeditor_widget.html.twig
<script type="text/javascript">
if (CKEDITOR.instances['{{ id }}']) {
delete CKEDITOR.instances['{{ id }}'];
}
{% for plugin_name, plugin in plugins %}
CKEDITOR.plugins.addExternal('{{ plugin_name }}', '{{ plugin.path }}', '{{ plugin.filename }}');
{% endfor %}
CKEDITOR.replace('{{ id }}', {{ config | raw }});
</script>
Hi there!
I'm trying to add styles to the styles menu in CKEditor. Trying to figure out how to add it to the default list while using the configuration method you explain in the docs of your bundle.
i tried with this :
ivory_ck_editor:
configs:
admin:
uiColor: "#000000"
styleSet.add: ( 'default', [
{ name: 'Just a test', element: 'h2', styles: { 'font-style': 'italic' } }
])
but the yaml parser bugs out on the syntax...
I also tried with :
ivory_ck_editor:
configs:
admin:
uiColor: "#000000"
styleSet.add: { name : 'Strong Emphasis ProjectName', element : 'strong' }
and this :
ivory_ck_editor:
configs:
admin:
uiColor: "#000000"
styleSet: { name : 'Strong Emphasis ProjectName', element : 'strong' }
they both don't do anything...
Do you know how I should go about for this?
Thanks!
Hi,
I just updated to 2.2.0 and i get the error:
You cannot create a service ("ivory_ck_editor.helper.templating") of an inactive scope ("request").
on cache:clear
The router
should not be a dependency of the ConfigManage
r. The router is used to generated the route, which is part of the presentation layer.
A valid implementation will be to move the router call into the view, the ConfigManager
will only generate the route name and route parameter.
What do you thing ?
Your bundle works perfectly with normal GET/POST requests, but I have a form that is an ajaxForm (jQuery), and POST data is not updated.
Ckeditor is supposed to work perfectly with ajax due to jQuery adapter. But it looks like ckeditor 4.x is not shipped with jQuery adapter.
Any help with this?
I'm asking it, because I nearly had problem with this - http://stackoverflow.com/questions/20571887/ckeditor-and-code-parsing-strange-change-after-submitting-code
The problem was the string was in raw format and then CKEditor cannot read correct HTML. If I use
in PHP templateOr
{{ value }} in Twig template
in files ckeditor_widget.html.php, ckeditor_widget.html.twig
The problem is solved and HTML is valid. This change has no impact on real source code in page, which loads data from entity submitted by ckeditor field. After this change, is my CKEditor working correctly.
After updating to dev-master
.
I believe it's caused by upgrading to ckeditor 4.1 since commit 9f2ddcc works just fine.
I have successfully configured CKEditor in my Symfony Project like this:
$ckconfig = array(
'toolbar' => array(
array(
'name' => 'basicstyles',
'items' => array('Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat'),
),
array(
'name' => 'paragraph',
'items' => array('NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote'),
),
array(
'name' => 'links',
'items' => array('Link','Unlink'),
),
),
'forcePasteAsPlainText'=> true
);
Since I have more Editors, I have tried to create a Global Configuration like this, but I still have less success:
$builder
->add('name', 'text', array('label' => 'Name'))
->add('description', 'ckeditor',
array('label' => 'Short Description',
'required' => false,
'config' => $ckconfig,
'trim' => true
)
)
ivory_ck_editor:
configs:
my_config:
toolbar: [How would the above config looks like here ?]
forcePasteAsPlainText: true
$builder
->add('name', 'text', array('label' => 'Name'))
->add('description', 'ckeditor',
array('label' => 'Kurztext',
'required' => false,
'config_name' => 'my_config',
'trim' => true
)
)
In my development environment web projects are accessed via http://localhost/project/web/app_dev.php. In such cases, config.js, language file and some others cannot load, as the browser looks for it in /bundles/ivoryckeditor/, which, of course, doesn't exists.
I found that changing line 9 in ckeditor_widget.html.twig from
var CKEDITOR_BASEPATH = '/bundles/ivoryckeditor/';
to
var CKEDITOR_BASEPATH = '{{ asset('bundles/ivoryckeditor/') }}';
solves the problem. I just didn't want to fork for this small modification... :)
Hi,
When using the ckeditor in sonata_type_collection pressing the "Add new" button adds a row where one of the fields is of type ckeditor. Write something in all the fields and then press again "Add new". The value entered in the ckeditor field in the fist row is lost. The values for the rest of the fields are kept.
Hi, maybe this isn't a issue but I'm getting "Column 'description' cannot be null" error while try to use the bundle. See I have this in my ProductType.php:
$builder
->add('upc', 'text', array('required' => true))
->add('name', 'text', array('required' => true))
->add('description', 'ckeditor', array('required' => false))
->add('age_limit', 'text', array('required' => false));
Then in my controller I do this:
$entityProduct = new Product ();
$form = $this->createForm(new ProductType(), $entityProduct);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entityProduct);
$em->flush();
}
For some reason or miss configuration from my part it's failing, where? Of course field have values (see the attached image)
$builder->add('description', 'ckeditor', array(
'config' => array(
'toolbar' => array(
array(
'name' => 'document',
'items' => array(),
),
'/',
array(
'name' => 'basicstyles',
'items' => array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'OrderedList', 'UnorderedList','-', 'RemoveFormat'),
),
),
'ui_color' => '#ffffff',
//...
),
));
I added list support however the tools do not appear in the toolbar. Where is the problem?
hi first i want to said that on the paper it look very nice, i just try Timymce and i got same probleme when it's time to refersh by ajax, jquery hope that this one dont have the same probleme.
i try to user on Symfony 2.3.2. is there problemes or not compatibility?
i get this error :
Fatal error: Call to undefined method Symfony\Component\Form\Form::getAttribute() in .....\zorg.dev\vendor\egeloen\ckeditor-bundle\Ivory\CKEditorBundle\Form\Type\CKEditorType.php on line 73
thank
Hello,
is it possible to use this bundle also as Inline editor:
http://docs.ckeditor.com/#!/guide/dev_inline
?
Since the upgrade from Symfony 2.0.12 to Symfony 2.0.13 I can't use the CKEditor anymore. The error message is the follow:
Fatal error: Declaration of Ivory\CKEditorBundle\Form\Type\CKEditorType::getDefaultOptions() must be compatible with that of Symfony\Component\Form\FormTypeInterface::getDefaultOptions() in /var/www/vendor/bundles/Ivory/CKEditorBundle/Form/Type/CKEditorType.php on line 123
Anyone have an idea what could be wrong? maybe a bug? else I didn't change anything else, except upgrading Symfony.
Hi,
In the readme for the fileupload elfinder integration, the example config uses:
filebrowserUploadRoute: elfinder
When I used it, I did get the "upload" tab in the CKEditor, but when uploading an image, it loaded the entire file manager into the small line where you can upload a file. It was really unusable for me.
Shouldn't the config be changed to:
filebrowserBrowseRoute: elfinder
That way you can use the "Browse on server" button for an image and use the Elfinder interface to upload/manage images and files.
hi
i try to integrate plugin (youtube, google map, ...) but i have error all the time !
"NetworkError: 404 Not Found - http://www.neo.com.dev/bundles/ivoryckeditor/plugins/youtube/?t=D6IEplugin.js"
?t=D6IEplugin.js
uncaught exception: [CKEDITOR.resourceManager.load] Resource name "youtube" was not found at "/bundles/ivoryckeditor/plugins/youtube?t=D6IEplugin.js".
config.aml
ivory_ck_editor:
default_config: default
plugins:
youtube:
path: "/bundles/ivoryckeditor/plugins/youtube"
filename: "plugin.js"
....
neoTest:
toolbar: 'neoToolbar_1' # full - standard - basic
filebrowserBrowseRoute: 'elfinder'
filebrowserBrowseRouteParameters: []
extraPlugins: "youtube"
toolbars:
configs:
neoToolbar_1:
- ['youtube','Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', '-','Link', 'Unlink', 'Anchor']
- ['Image', 'Table', 'HorizontalRule', 'SpecialChar' ,'-' ,'Maximize','Source' ]
- "/"
- ['Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ,'-' ,'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote']
- "/"
- [ "Maximize", 'Styles', 'Format', 'About']
what cam it be? can you help?
thank.
The bundle only defines a Twig template and so, made it only usable with it. We should allows end users to use it with the PHP template engine.
Hi,
I can currently edit the config.js file in the bundle to change the language option, is there a way this can be done in my own bundle?
Much in the same way that I can specify an array of toolbar options
When I run
app/console assets:install
this overwrites config.js. This can considered to be normal, as this is what assets:install does. However, this way I have to continuously update config.js. Is there a way to solve it?
When adding ckeditor in a collection form type (right now using sonata) like above, ckeditor is shown as textarea (no rich editor):
class AType extends AbstractType
{
$builder->add( 'titol', 'text', array( 'label' => 'titol' ) )
->add( 'sotsTitol', 'text', array( 'label' => 'titol' ) )
->add( 'blocs', 'collection', array(
'type' => new \myVendor\myBundleBundle\Form\Type\BType(),
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false
)
)
;
........
class BType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilder $builder, array $options)
{
$builder->add( 'href', 'text', array() )
->add( 'imatge', 'text', array() )
->add( 'altImatge', 'text', array() )
->add( 'titol', 'text', array() )
->add( 'text', 'ckeditor', array() )
;
}
Without running
php app/console assets:install web --symlink
after installation instructions ckeditor form field will look just like a textarea.
https://github.com/egeloen/IvoryCKEditorBundle/blob/master/Resources/doc/installation.md
I created some widgets (eg. "videobox") using the latest ckeditor package, inserted them in the Ivory/Resources/public/plugins/videobox and tried to use them (config.extraPlugins = 'videobox').
But the editor returns an error that the "editables" is an unknown function, which is a crucial for the widget component. (Also the "widget" plugin was also missing.)
Does bundle support widgets/custom widgets? Do you plan to upgrade the bundle in near future?
It would be nice to have a default configuration, so if one would like to alter the behavior of all the instances he won't be forced to go over and set config_name
per each form type.
I'm currently using the SonataAdminBundle and would like to add extraAllowedContent
setting and I don't seem to have an easy way for doing so.
I should extend the bundle and override all its form types which are using ckeditor. I find this pretty annoying.
I'm trying to configure the enterMode so I can use
instead of
and chrome is throwing this error:
Cannot read property 'br' of undefined
My configuration is quite simple:
ivory_ck_editor:
configs:
simple:
toolbar: [ [ "Bold", "Italic", "Underline", "-", "RemoveFormat", "-", "Maximize" ] ]
enterMode: "CKEDITOR.ENTER_BR"
shiftEnterMode: "CKEDITOR.ENTER_BR"
¿How can we use the CKEDITOR.<> defines?
In my project we use assets_version to bust caches. Unfortunately this breaks functionality for CKEDITOR_BASEPATH
( /Resources/views/Form/ckeditor_widget.html.twig line 9).
Currently the only workable fix I found was modifying the variable definition in javascript ( /Resources/public/ckeditor.js):
var d=window.CKEDITOR_BASEPATH.replace(/\?.*/, '')||'';
Sadly, twig doesn't have a regexp replace, nor can I find a way to get an asset without a version appended.
hth
Hi!
I added the templates plugin to CKEditor and it works fine. The only problem I'm having is figuring out how I can add templates from my config.yml. I've been trying with this config layout. The templates list is emptied (if I remove my template, the list is populate by the default values which are part of the plugin) which makes me think that I'm almost there, but my template doesn't appear in the list.
extraPlugins: templates
templates :
-
title : 'My template'
description : 'Description for my template'
html : '<h2>Template 1</h2>'
Another example would be :
extraPlugins: templates
templates :
-
title : 'My other template'
description : 'Description for my other template'
html :
-
'<h2>Template 1</h2>'+
'<small>Template 1</small>'
Any idea?
When I installed IvoryCKEditorBundle, CKeditor didn't show up. Firebug telled me it was because some files were not found.
They were not found because they were searched at http://localhost/ and not at http://localhost/my_project/.
I suggest this to fix it :
In Resources/view/Form/ckeditor_widget.html.twig :
Replace this line : var CKEDITOR_BASEPATH = '../../bundles/ivoryckeditor/';
By this : var CKEDITOR_BASEPATH = '{{ asset('bundles/ivoryckeditor') }}/';
It will automatically search the files in the assets directory.
Hi guys,
I try to integrate the filebrowser* but i can't, is not clear in the documentation. How can i integrate?
Thanks!
I need to render the editor with a preset data.
Im trying this:
$builder->add('history', 'ckeditor', array( 'toolbar' => $toolbar , 'data' => $dados));
but its not working at all..
what should i do?
Hi I'm working on a CMS and I want to use your bundle but I have one problem with it.
Now if I want to add a wysiwyg field I found that I should modify my admin classes to add a ckeditor field.
As I don't want to couple my cms to ckeditor, my need is to have a twig extension to render in my layout to enhance textarea with wysiwyg classes.
Have you done this before ?
Hi,
I'm using your IvoryCKEditorBundle. It is working great with regular Post/Get forms. However, I also have a form which I load through an ajax call and when I load it in that way, I get 404 messages:
GET http://project/admin/config.js?t=B8DJ5M3 404 (Not Found)
GET http://project/admin/lang/en.js?t=B8DJ5M3 404 (Not Found)
Uncaught TypeError: Cannot read property 'options' of undefined
GET http://project/admin/skins/kama/editor.css?t=B8DJ5M3 404 (Not Found)
Any idea how I can make it work with ajax loaded forms?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.