numaxlab / nova-ckeditor5-classic

A Laravel Nova CKEditor5 Classic Field.
MIT License
39 stars 41 forks source link

Create link with target _blank #11

Closed ghost closed 4 years ago

ghost commented 4 years ago

I updated CKEditor to be able to add target attribute to link.

Exemple of configuration :

return [
    'options' => [
        'language' => 'en',
        'plugins' => ['Link'],
        'toolbar' => [
            'Heading',
            'Bold',
            'Italic',
            '-',
            'Link',
        ],
        'link' => [
          'addTargetToExternalLinks' => true,
          'decorators' => [
            'isExternal' => [
                'mode' => 'manual',
                'label' => 'Open in a new tab ?',
                'attributes' => [
                    'target' => '_blank',
                    'rel'=> 'noopener noreferrer'
                ]
            ],
          ]
        ],
    ]
];
desaintflorent commented 4 years ago

I didn't manage to add link option for target link to the editor. Is this functionality working for anybody ? config/ckeditor5Classic.php is the only thing to update ?

oriolfg commented 4 years ago

It doesn’t work for me either