0

I managed to run the upload images via WYSIWYG CKEditor using SonataMediaBundle and CoopTilleulsCKEditorSonataMediaBundle.

My question is, I do not understand what is the meaning of the elements of this syntax:

CKEditor form fields:

        $builder
        ->add(
            'body',
            'ckeditor',
            array(
                'config' => array(
                    'toolbar' => array(
                        array(
                            'name' => 'links',
                            'items' => array('Link','Unlink'),
                        ),
                        array(
                            'name' => 'insert',
                            'items' => array('Image'),
                        ),
                    )
                )
            ));

Thanks !!

user3588551
  • 83
  • 10

1 Answers1

0

It is just a default configuration setting of usage of ckeditor in your form, anyway if u want to more detail u may follow the link: Ivory Ckeditor Usage

Ajeet Varma
  • 726
  • 4
  • 20
  • Thank you, another question :) When I use this syntax, I lose WISIWIG other options, only the little icon that allows you to upload an image still presente, what it must be added to reset all options WISIWIG – user3588551 Jul 08 '14 at 09:00
  • You may use like $builder->add('body','ckeditor') only in your form, it will show all the available options of this editor , for any more configuration u may do it config.yml as describe on the link https://github.com/egeloen/IvoryCKEditorBundle/blob/master/Resources/doc/configuration.md – Ajeet Varma Jul 08 '14 at 09:16
  • Anothor basic question please, when I write a paragraph with ckeditor, i get the paragraph with html tags setting by the WISIWIG, for exemple when i write ---> hello world; i got ----->

    hello world

    and this for all options; do you know why please, thank you very much !!
    – user3588551 Jul 08 '14 at 09:52
  • because in this ckeditor all the components have like paragraph, line, italic etc are inbuilt with html source code due to which its show like this , but in your twig u may use raw option like {{ value | raw }} and this will show what u actually want ..where value is any entity value for which ckeditor is uded in form .. – Ajeet Varma Jul 08 '14 at 09:59
  • I have tried {{ value | raw }}, but dosen't work for the latest question !! – user3588551 Jul 09 '14 at 15:52
  • I back to you to asking a question please :) ; upload by ckeditor works well for a user that has the ADMIN ROLE, but does not work for normal users.. do you have any idea ? Thanks ! – user3588551 Jul 11 '14 at 11:19
  • The problem of uploading is with coopTilleuls/CoopTilleulsCKEditorSonataMediaBundle , because in this bundle your config for uploading is like this ivory_ck_editor: default_config: default configs: defaul: filebrowserImageUploadRoute: admin_sonata_media_media_ckeditor_upload filebrowserImageUploadRouteParameters: provider: sonata.media.provider.image context: my-context # Optional, to upload in a custom context You are usings admin_sonata_media_media_ckeditor_upload which is accessible for only ROLE_ADMIN. – Ajeet Varma Jul 12 '14 at 04:39
  • ROLE_ADMIN should be changed like ROLE_USER in your security.yml for sonatamediabundle .. – Ajeet Varma Jul 12 '14 at 04:44
  • I understand the problem, by against I did not understand your solution: "ROLE_ADMIN should be changed like ROLE_USER in your security.yml for sonatamediabundle" .. because sonatamediabundle is not configued in security.yml, can you represent your idea into lines of code please, thank you very much! – user3588551 Jul 13 '14 at 10:50
  • Ajeet Varma, Please :) – user3588551 Jul 15 '14 at 07:25
  • sorry for delay to response, but still i am also unable to do it because we use sonatamediabundle for uploding and browsing , and sonatamediabundle is accessible only to ROLE_ADMIN , so either we change user role of sonatamediabundle or we use another route for uploading or browse the image. for uploading i m still trying to find optional routes but for browse_url you can use https://github.com/helios-ag/FMElfinderBundle; and also ,in your security.yml please do't forget to include these lines "access_control:- { path: ^/efconnect, role: ROLE_USER }- { path: ^/elfinder, role: ROLE_USER }" – Ajeet Varma Jul 16 '14 at 03:47