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

CKEditorConfig #75

Open
TalentedPianist opened this issue Jan 6, 2024 · 1 comment
Open

CKEditorConfig #75

TalentedPianist opened this issue Jan 6, 2024 · 1 comment
Assignees

Comments

@TalentedPianist
Copy link

Maybe not an issue but can't find any other way to ask you. Got it working in my Blazor project. What I need is to configure the toolbar of the instance using the CKEditorConfig property. I need different toolbars for different instances. Thinking the best way for that is to use an element reference in each component. Can you provide example syntax for this please?

Also just to note that in Blazor 8 I had to set the ScriptPath and StylePath in order to make it work, this isn't mentioned in the documentation.

Thank you

Douglas

@SonicGD
Copy link
Member

SonicGD commented Jan 12, 2024

Hello. Sorry for delay. I've updated readme with info about ScriptPath and StylePath. Also added to demo app example with custom toolbar.

You just need to create config something like this:

configCustom = CKEditorBundleOptions.DefaultConfig;
configCustom.Toolbar = new CKEditorToolbar
{
    Items =
    [
        "bold",
        "italic",
        "strikethrough",
        "underline",
        "|",
        "removeFormat"
    ]
};

and use it for editor instance:

<CKEditor @bind-Value="@ModelInstance.Html" Config="@configCustom" />

@SonicGD SonicGD self-assigned this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants