Nova Ckeditor
  • 🏁Getting Started
    • Introduction
    • Installation
    • Support Us
    • License
    • Demo
  • 🚀Basic Usage
    • Usage
    • Notes
  • ⚙️Advanced Usage
    • Customize ImageStorage
    • Integrating NovaFileArtisan (Larupload) with Image Resource
    • Customize AudioStorage
    • Customize FileStorage
    • Multiple Toolbars
    • Customize Toolbar Items
    • Media Embed
    • CkEditor Field Options
      • Toolbar
      • Height
      • Limit On Index
      • Content Language
      • Force Paste as Plain Text
      • Alert Before Unsaved Changes
      • Text Part Language
      • General HTML Support
      • Group Items In Overflow Mode
      • Image Browser
      • Audio Browser
      • Video Browser
      • File Browser
      • Snippets
    • Configuration
      • Video Model
      • Image Model
      • Memory
      • Max Image Quality
      • Image Max Width
      • Image Max Height
      • Image Naming Method
      • Image Processing Library
      • Audio Naming Method
      • File Naming Method
      • Toolbars
        • Default Toolbar
        • Toolbar 1
          • Height
          • Items
          • Options
          • Content Lang
          • Force Paste as Plain Text
          • Alert Before Unsaved Changes
          • UI Language
            • UI Language Name
            • UI Language Script
          • Text Part Language
          • General HTML Support
          • Group Items In Overflow Mode
          • Image Browser
          • Audio Browser
          • Video Browser
          • File Browser
          • Insert Image Types
          • Insert Image Size
          • Snippets
  • ⚪Other
    • Migration
    • Credit and Thanks
Powered by GitBook
On this page
Edit on GitHub
  1. Advanced Usage

Multiple Toolbars

To utilize multiple toolbars in your Nova resources, you can easily duplicate the configuration of toolbars.toolbar-1 in the config/nova-ckeditor.php file. Then, you can reference the cloned toolbar configuration in the options of your CkEditor fields.

  1. Add a new array item to the toolbars array, defining your new toolbar. For example:

config/nova-ckeditor.php
return [
    'toolbars' => [
        'toolbar-1' => [
            ...
        ],
        'toolbar-2' => [
            ...
        ],   
    ]
];
  1. Use it in your CkEditor field:

use Mostafaznv\NovaCkEditor\CkEditor;

class Article extends Resource
{
    public function fields(Request $request): array
    {
        return [
            ID::make()->sortable(),

            // this field uses the default toolbar (toolbar-1)
            CkEditor::make(trans('Content'), 'content')
                ->stacked(),

            CkEditor::make(trans('Description'), 'description')
                ->toolbar('toolbar-2')
                ->stacked()
        ];
    }
}
PreviousCustomize FileStorageNextCustomize Toolbar Items

Last updated 1 year ago

⚙️