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

Adding TinyMCE Plugins #506

Closed
irdublu opened this issue Mar 28, 2022 · 5 comments
Closed

Adding TinyMCE Plugins #506

irdublu opened this issue Mar 28, 2022 · 5 comments
Milestone

Comments

@irdublu
Copy link

irdublu commented Mar 28, 2022

Is it possible to add TinyMCE Plugins to enhance the existing offerings? I'm needing Forecolor, Backcolor and Preview. I've looked at the Installing Plugins and HTML docs pages and have done some experimenting without success. I do not understand if TinyMCE Plugins can be included and, if they can, I don't know how.

@HeyJoel
Copy link
Member

HeyJoel commented Mar 28, 2022

Have you looked at customizing the TinyMCE config? Any custom config fields you supply overwrite the default config, so you should be able to add your custom plugin selection and toolbar configuration there. E.g. I could add this via a json file like so:

ExampleDataModel .cs

public class ExampleDataModel : ICustomEntityDataModel
{
    [Html(ConfigFilePath = "/content/html-editor-config.json")]
    public string Content { get; set; }
}

html-editor-config.json

{
  "toolbar": "preview forecolor backcolor",
  "plugins": "preview textcolor",
}

Doing so will overwrite the existing plugin configuration, so you'll want to include any other plugin references you may need. The default Cofoundry selection is link image media fullscreen imagetools code.

@irdublu
Copy link
Author

irdublu commented Mar 29, 2022

Yes, I found and read the HTML page and tried many things that were wrong, hence needing to raise my question, but I had no idea how simple you have made it for us. I've used a HtmlEditorConfigSource class dictionary and it works. Thank you very much.

@HeyJoel
Copy link
Member

HeyJoel commented Mar 30, 2022

Perhaps the documentation is not clear/detailed enough, would an example similar to above have helped?

@HeyJoel HeyJoel added this to the 0.11 milestone Mar 30, 2022
@irdublu
Copy link
Author

irdublu commented Mar 30, 2022

Definitely, yes.

@HeyJoel HeyJoel changed the title TinyMCE Plugins Adding TinyMCE Plugins Jul 29, 2022
@HeyJoel
Copy link
Member

HeyJoel commented Jul 29, 2022

Docs updated, will be published with the release of Cofoundry v0.11

@HeyJoel HeyJoel closed this as completed Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants