2amigos / yii2-ckeditor-widget

CKEditor WYSIWYG widget for Yii2.
https://2amigos.us/open-source/ckeditor-widget
Other
172 stars 112 forks source link

Show source button in 'preset' => 'basic', #74

Closed shahzadthathal closed 8 years ago

shahzadthathal commented 8 years ago

Hi,

How I can show view source button in toolbar, I'm using basic editor?

Thanks

tonydspaniard commented 8 years ago

@shahzadthathal you need to configure the attribute preset to be custom and then use your very own configuration:

'preset' => 'custom', 
'clientOptions' =>  [
    // .... 
    'toolbarGroups' => [
        ['name' => 'undo'],
        ['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
        ['name' => 'colors'],
        ['name' => 'links', 'groups' => ['links', 'insert']],
        ['name' => 'others', 'groups' => ['others', 'about']],

    ],
    'removeButtons' => 'Subscript,Superscript,Flash,Table,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe',
    'removePlugins' => 'elementspath',
    'resize_enabled' => false
]

Nevertheless, I think you need to follow this: http://sdk.ckeditor.com/samples/sourcearea.html and add the extra config setting

baltechies commented 6 years ago

Hi, I have followed the How to add custom plugins documentation as you mentioned, to add the extra plugin sourcearea. But button is not visible in toolbaar.