emilianotisato / nova-tinymce

Laravel Nova TinyMCE editor (with images upload capabilities!)
MIT License
116 stars 38 forks source link

Default TinyMCE config #21

Closed pxlrbt closed 4 years ago

pxlrbt commented 4 years ago

Hey, a possibility to set the default TinyMCE configuration would be nice!

emilianotisato commented 4 years ago

If you do not pass anything it already has a sensible default, did you try it??

On Mon, Jan 6, 2020, 1:29 PM Dennis Koch notifications@github.com wrote:

Hey, a possibility to set the default TinyMCE configuration would be nice!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/emilianotisato/nova-tinymce/issues/21?email_source=notifications&email_token=AEN4C5Y7LRNHAAOCGQ6EA6DQ4OBBHA5CNFSM4KDJFMIKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IEJXPKA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEN4C55D4V3OI7LPE4OTGULQ4OBBHANCNFSM4KDJFMIA .

pxlrbt commented 4 years ago

Sorry, for the misleading explanation. It would be nice, if there was a possibility to overwrite this default to a different default.

emilianotisato commented 4 years ago

Ok, you mean you have many resources in your project or many textarea fields in one resource in where you want a default that is different to the default in the package??

In that case, you can for example have a property in you main App/Nova/Resource.php file, something like this:

public $defaultTinyMceConf = [//... Your custom config array];

Then in every field you pass that options with $this->$defaultTinyMceConf

This is temporary, you can submit a PR and put the default in the config file of the package so that can be published and override on demand?

pxlrbt commented 4 years ago

Ok, you mean you have many resources in your project or many textarea fields in one resource in where you want a default that is different to the default in the package??

Yep. You got me right.

In that case, you can for example have a property in you main App/Nova/Resource.php file

That sounds like a good temporary solution. Did not think about it. Thanks.

This is temporary, you can submit a PR and put the default in the config file of the package so that can be published and override on demand?

I thought about something like a configuration file, so everybody can adjust the defaults to their needs. Maybe I can open a PR for that next week.

rubenestevao commented 4 years ago

I @emilianotisato

I made a pull request that closes this issue. Please check #24