marshmallow / nova-tinymce
This Nova package allow you to use TinyMCE editor for text areas.You can customize the editor options and... you can upload images to your server and put them rigth there on the text without leaving the text editor!
Installs: 13 630
Dependents: 4
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 17
Language:CSS
Requires
- php: ^8.0
- laravel/nova: ^4.0
- dev-master
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- dev-266-add-dependson-to-the-tinymce-field
- dev-nova4
- dev-dependabot/composer/laravel/nova-4.22.2
- dev-dependabot/npm_and_yarn/dns-packet-5.4.0
- dev-dependabot/npm_and_yarn/tinymce-6.3.2
- dev-dependabot/npm_and_yarn/sass-1.58.3
- dev-dependabot/npm_and_yarn/vue/compiler-sfc-3.2.47
- dev-dependabot/composer/symfony/http-kernel-6.0.20
- dev-dependabot/npm_and_yarn/postcss-8.4.21
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/github_actions/overtrue/phplint-8.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/sass-loader-13.2.0
- dev-dependabot/npm_and_yarn/vue-loader-17.0.1
- dev-dependabot/npm_and_yarn/vuex-4.1.0
- dev-dependabot/npm_and_yarn/inertiajs/inertia-0.11.1
- dev-dependabot/npm_and_yarn/terser-4.8.1
- dev-dependabot/npm_and_yarn/laravel-mix-6.0.49
- dev-development
- dev-stefvanesch-patch-1
This package is auto-updated.
Last update: 2024-12-16 10:33:13 UTC
README
Laravel Nova TinyMCE editor
This Nova package allows you to use TinyMCE editor for text areas. You can customize the editor options.
Composer
You can install the package via composer:
composer require marshmallow/nova-tinymce
Installation
Run the command bellow, to publish TinyMCE JavaScript and CSS assets.
php artisan vendor:publish --provider="Marshmallow\Nova\TinyMCE\FieldServiceProvider" --tag="resources"
Usage
Include TinyMCE
in your fields array on the Nova Resource.
use Marshmallow\Nova\Tinymce\TinyMCE; public function fields(Request $request) { return [ ID::make()->sortable(), TinyMCE::make(__('Content'), 'content'), ]; }
Add custom HTML (buttons)
To add buttons or custom html with the click of a button, you can call the buttons()
method when you're making the field.
TinyMCE::make('body')->buttons([ 'Name button' => 'value of HTML', 'Name button2' => '<p>More HTML</p>' ]),
Add variables
To add variables with the click of a button, you can call the variables()
method when you're making the field. More docs see: https://www.npmjs.com/package/icp-tinymce-variable
TinyMCE::make('body')->variables([ 'name_var' => 'value_var', ]),
Set the height
The default height of the TinyMCE editor is handled by the nova-tinymce.php
config file. If there is a need to change the height on some TinyMCE fields, you can do this by calling the height()
method when you're making the field.
TinyMCE::make('body')->height(300),
Override config file
You can publish the config and override all TinyMCE
settings.
php artisan vendor:publish --provider="Marshmallow\Nova\TinyMCE\FieldServiceProvider" --tag="config"
Adding custom styling
If you want to add an extra styling that can be used on all TinyMCE fields, you need to publish the config file. In can add your custom styling options to the custom_items
array in the config file. These custom styling options should look like the example below.
'custom_items' => [ // This will add a .lead class on the paragraph tag. [ 'title' => 'Lead Paragraph', 'block' => 'p', 'classes' => 'lead', ], ],
Plugin customization
You can pass any configuration option for the javascript SDK to the array in the options()
method.
For example, you like to have increased the height of the text area:
TinyMCE::make('body')->options([ 'height' => '980' ]),
You can see the full list of parameters in the docs: https://www.tiny.cloud/docs/configure/
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.