Open drososanastasios opened 5 years ago
Do you solve this? I meet the same problem.
I didn't have time to look this up, also never used webpack/encore. Do you have any idea what could be wrong? Will try to look this up when I find some time
@ktherage have you run into these issues by any chance?
@kunicmarko20 sorry I didn't use templates with ckeditor. But I'll try it and I'll keep informed.
But anyway to point out the clue, @drososanastasios it seems to be the installed ckeditor version to be in cause. Can you tell us what is the version you've installed (check in the package.json file)?
Well, i tried this quickly and it seems that extraPlugins
is not applied to the node_module/ckeditor
.
I don't known how this work under the hood.
Thank you @ktherage! At least its a clue, will try to take a look over the weekend
I'm using FOSCKEditor 2.4 (composer.json) with ckeditor 4.19.1 (package.json) in a Symfony 6 application with webpack (symfony/webpack-encore-bundle) :
I still have the same error as stated by @drososanastasios Uncaught TypeError: CKEDITOR.addTemplates is not a function
->add('value', CKEditorType::class, [
'label' => 'settingsmessage.fieldvalue',
'required' => false,
'config_name' => 'fulleditor_template',
'config' => [
'extraPlugins' => 'templates',
'templates' => 'my_templates'
],
'templates' => [
'my_templates' => [
'imagesPath' => '/public/fileuploads/templates',
'templates' => [
[
'title' => 'Template 11',
'description' => 'desc template 1',
'html' => '<p>template 1</p>',
],
[
'title' => 'Template 22',
'description' => 'desc template 2',
'html' => '<p>template 2</p>',
],
]
]
],
])
However, if i "just" add the "templates" plugin without defining some custom template in my form,
->add('value', CKEditorType::class, [
'label' => 'settingsmessage.fieldvalue',
'required' => false,
'config_name' => 'fulleditor_template',
'config' => [
'extraPlugins' => 'templates',
]
)
then the CKEditor is not broken and the default templates are available.
Environment
Symfony 4.2
Symfony packages
friendsofsymfony/ckeditor-bundle: 2.1.0,
I started a fresh symfony flex project and I installed webpack based on documentation. What I did next is that I followed the documentation in order to install ckeditor bundle based on:
https://symfony.com/doc/master/bundles/FOSCKEditorBundle/installation.html
Since I try to migrate from symfony 3.4 to symfony 4 I used the same configuration as before that contains templates. Without the templates everything works as expected.
Steps to reproduce
Add a simple configuration that contain templates:
Expected results
An editor that contains the templates.
Actual results
The editor is shown as simple text. In console.log I see that: