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

Use a custom CKEditor build #6

Closed
wants to merge 5 commits into from
Closed

Conversation

radwanic
Copy link

@radwanic radwanic commented Aug 5, 2019

Hi,
First I'd like to thank you for the great work you've done here.

The field is awesome, but the CLEditor build itself is missing lots of plugins.

I was able to use another custom build that has more plugins such as alignment. I also added a min-height to the editor's box, as well as the proper separators.

image

@radwanic radwanic changed the title Use another CKEditor build Use a custom CKEditor build Aug 5, 2019
@radwanic
Copy link
Author

radwanic commented Aug 7, 2019

Had to vcs, no longer a valid PR

@radwanic radwanic closed this Aug 7, 2019
@arthurdotwork
Copy link

Hi @radwanic, is it possible to made the PR again or to provide an installation procedure for your fork ?

Thanks.

@radwanic
Copy link
Author

radwanic commented Oct 9, 2019

@arthureichelberger in your composer.json, add "radwanic/nova-ckeditor5-classic": "*" under require

"require": {
      ...
     "radwanic/nova-ckeditor5-classic": "*" 
}

And use this vcs under repositories

"repositories": [
    ...
   {
       "type": "vcs",
       "url": "https://github.com/radwanic/nova-ckeditor5-classic"
   }
]

Then you can use whatever options you need in your config file (ckeditor5Classic.php)... Here is mine...

<?php
return [
    'options' => [
        'language' => 'en',
        'toolbar' => [
            'Heading',
            '|',
            'Bold',
            'Italic',
            '|',
            'NumberedList',
            'BulletedList',
            'BlockQuote',
            '|',
            'Link',
            'MediaEmbed',
            'imageUpload',
            '|',
            'insertTable',
            'tableColumn',
            'tableRow',
            'mergeTableCells',
            '|',
            'alignment:left',
            'alignment:center',
            'alignment:right',
            '|',
            'Undo',
            'Redo',
        ],
        'table' => [
            'contentToolbar' => [
                'tableColumn',
                'tableRow',
                'mergeTableCells',
            ]
        ],
        'image' => [
            'toolbar' => [
                'imageTextAlternative', '|',
                'imageStyle:alignLeft',
                'imageStyle:full',
                'imageStyle:alignRight'
            ],
            'styles' => [
                // This option is equal to a situation where no style is applied.
                'full',
                // This represents an image aligned to the left.
                'alignLeft',
                // This represents an image aligned to the right.
                'alignRight',
            ]
        ],
        'heading' => [
            'options' => [
                ['model' => 'paragraph', 'title' => 'Paragraph', 'class' => 'ck-heading_paragraph'],
                ['model' => 'heading1', 'view' => 'h1', 'title' => 'Heading 1', 'class' => 'ck-heading_heading1'],
                ['model' => 'heading2', 'view' => 'h2', 'title' => 'Heading 2', 'class' => 'ck-heading_heading2'],
                ['model' => 'heading3', 'view' => 'h3', 'title' => 'Heading 3', 'class' => 'ck-heading_heading3'],
                ['model' => 'heading4', 'view' => 'h4', 'title' => 'Heading 4', 'class' => 'ck-heading_heading4'],
                ['model' => 'heading5', 'view' => 'h5', 'title' => 'Heading 5', 'class' => 'ck-heading_heading5'],
                ['model' => 'heading6', 'view' => 'h6', 'title' => 'Heading 6', 'class' => 'ck-heading_heading6'],
            ],
        ],
    ]

];

@arthurdotwork
Copy link

Thanks you, you're saving me a lot of time !

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

Successfully merging this pull request may close these issues.

2 participants