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

Impossible to customize Toolbar #207

Open
kendyan opened this issue Dec 17, 2019 · 4 comments
Open

Impossible to customize Toolbar #207

kendyan opened this issue Dec 17, 2019 · 4 comments

Comments

@kendyan
Copy link

kendyan commented Dec 17, 2019

Symfony packages

"php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "friendsofsymfony/ckeditor-bundle": "^2.1", "sensio/framework-extra-bundle": "^5.1","symfony/asset": "4.4.*", "symfony/console": "4.4.*", "symfony/dotenv": "4.4.*", "symfony/expression-language": "4.4.*", "symfony/flex": "^1.3.1", "symfony/form": "4.4.*", "symfony/framework-bundle": "4.4.*", "symfony/http-client": "4.4.*", "symfony/intl": "4.4.*", "symfony/mailer": "4.4.*", "symfony/monolog-bundle": "^3.1", "symfony/orm-pack": "*", "symfony/process": "4.4.*", "symfony/security-bundle": "4.4.*", "symfony/serializer-pack": "*", "symfony/translation": "4.4.*", "symfony/twig-pack": "*", "symfony/validator": "4.4.*", "symfony/web-link": "4.4.*", "symfony/webpack-encore-bundle": "^1.7", "symfony/yaml": "4.4.*"

Subject

Impossible to customize the toolbar

Here my fos_ckeditor.yaml

fos_ck_editor: configs: my_config_1: toolbar: "my_toolbar_1" uiColor: "#e2e2e2" toolbars: configs: my_toolbar_1: [ "@document", "/", "@link" ] items: document: ["Source", "-", "Save"] links: ["Link", "-", "Unlink"]
Capture d’écran 2019-12-17 à 08 22 31

Actual results

Undefined index my_toolbar_1
Capture d’écran 2019-12-17 à 08 21 42

@proArtex
Copy link

proArtex commented May 3, 2020

It is a bug actually. I solved this by specifying a toolbar under form's type_options.config.toolbar. Not a clean solution though, since the rest of my config is in fos_ck_editor.yaml.

@m-ar-c
Copy link

m-ar-c commented Sep 21, 2022

I'm bitten by the exact same bug too.

@proArtex , any chance you can elaborate on what you did please ?

@m-ar-c
Copy link

m-ar-c commented Sep 22, 2022

Well, this is not a bug, it's just us being too dumb or not awaken enough...

Here's what works :

$builder->add('description', CKEditorType::class,
              ['config' => ['toolbar' => 'my_custom_toolbar'] ]);
fos_ck_editor:
    default_config: default

    configs:

        default:
            toolbar:
            # whatever here

    toolbars:
      configs:
        my_custom_toolbar: [
        '@standard.clipboard',
        '@standard.editing',
        ['Table', 'HorizontalRule', 'SpecialChar'],
        '@standard.tools',
        '@standard.document',
        '@standard.basic_styles',
        '@standard.paragraph',
        '@standard.about',
        ]

So the toolbars node must not be under configs, but at the same level.

Almost three year later, we can now close this "bug" I think... 🙂

@josephzhao
Copy link

$formMapper
->with('Login Page Messages', array('class' => 'col-md-6'))
->add('title')
->add('enabled', null, array('label' => ''))
->add('message', CKEditorType::class, ['label' => 'Message Content',
'config' => ['toolbar' => 'my_custom_toolbar'], "attr" => ["style" => "width:100%;height:250px"]])

I am not able to make it works, no toolbar displayed

Thank you very much

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

4 participants