Xin cách Config toolbar toolbarGroups editorConfig ckeditor

Thảo luận trong 'Lập trình website' bắt đầu bởi seolagi, 10/11/20.

  1. seolagi

    seolagi

    Moderator

    Thành viên BQT

    Tham gia ngày:
    16/4/14
    Bài viết:
    960
    Đã được thích:
    77
    Điểm thành tích:
    28
    Cho mình hỏi cách cấu hình config Config toolbar toolbarGroups editorConfig của ckeditor như thế nào vậy? mình muốn ẩn hiện cái config các item của nó như thế nào các bạn nào biết chỗ nào tổng hợp để mình điều chỉnh điều hướng được không?
    Hiện tại cái config của mình nó hiện hết lên rất khó chịu, nhiều cái không cần xài thì nó cứ hiện, cảm ơn.

    config-ckeditor.png
     
    Cảm ơn đã xem bài:

    Xin cách Config toolbar toolbarGroups editorConfig ckeditor

  2. admin

    admin Phạm Công Sơn Thành viên BQT

    Tham gia ngày:
    22/5/13
    Bài viết:
    4,622
    Đã được thích:
    1,131
    Điểm thành tích:
    113
    Giới tính:
    Nam
    Bên CKeditor có cung cấp cho bạn 1 công cụ khá hư ích để chỉnh sửa trực quan và lấy về thống số config rất dễ dàng tại link dưới nhé, bạn vào đó check chọn cái cần và lấy về config thôi, khá đơn giản.

    Link: https://ckeditor.com/latest/samples/toolbarconfigurator/index.html#basic

    VD: 1 config chuẩn tải về ở link trên như sau
    PHP:
    /**
     * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
     * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
     */

    CKEDITOR.editorConfig = function (config) {

        
    config.toolbarGroups = [
            { 
    name'document'groups: ['mode''document''doctools'] },
            { 
    name'clipboard'groups: ['clipboard''undo'] },
            { 
    name'editing'groups: ['find''selection''spellchecker''editing'] },
            { 
    name'forms'groups: ['forms'] },
            
    '/',
            { 
    name'basicstyles'groups: ['basicstyles''cleanup'] },
            { 
    name'paragraph'groups: ['list''indent''blocks''align''bidi''paragraph'] },
            { 
    name'links'groups: ['links'] },
            { 
    name'insert'groups: ['insert'] },
            
    '/',
            { 
    name'styles'groups: ['styles'] },
            { 
    name'colors'groups: ['colors'] },
            { 
    name'tools'groups: ['tools'] },
            { 
    name'others'groups: ['others'] },
            { 
    name'about'groups: ['about'] }
        ];

        
    config.removeButtons 'JustifyCenter,JustifyRight,JustifyBlock,Styles,Font,FontSize,JustifyLeft,Outdent,Indent,CreateDiv';

        
    config.entities_latin true;
        
    config.htmlEncodeOutput false;
        
    config.entities false;

        
    config.uiColor '#66AB16';
        
    config.width '100%';
        
    config.height '800px';
        
    // Set the most common block elements.
        
    config.format_tags 'p;h1;h2;h3;pre';

        
    // Simplify the dialog windows.
        
    config.removeDialogTabs 'image:advanced;link:advanced';

        
    config.language 'vi';
        
    // config.uiColor = '#AADC6E';
        
    config.ForceSimpleAmpersand true;
        
    config.extraPlugins 'youtube';
        
    config.youtube_responsive true;
        
    config.youtube_related true;
    };
    PHP:
    <script src="~/ckeditor/ckeditor.js"></script>
    <
    script src="~/ckfinder/ckfinder.js"></script>
    <
    script>
        
    CKFinder.setupCKEditor(null'/ckfinder');
        
    CKEDITOR.replace('idckeditor');
    </
    script>
     
    Chỉnh sửa cuối: 10/11/20
    seolagi thích bài này.
  3. seolagi

    seolagi

    Moderator

    Thành viên BQT

    Tham gia ngày:
    16/4/14
    Bài viết:
    960
    Đã được thích:
    77
    Điểm thành tích:
    28
    Cảm ơn ad, m làm được rồi ạ
     



Like và Share ủng hộ ITSEOVN