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

How to edit only parts of the html and each part will have ckeditor/toolbar? #16422

Open
jon9090 opened this issue May 25, 2024 · 0 comments
Open
Labels
type:question This issue asks a question (how to...).

Comments

@jon9090
Copy link

jon9090 commented May 25, 2024

📝 Ask a Question

I received an HTML template from the server like this:

<div>
    <div>This is not allowed to edit</div>
    <div class="foo">Not editable <div class="can-edit">Content editable</div></div>
    <div class="bar">Not editable <div class="can-edit">Content editable</div></div>
</div>

I want to restrict user editing to only the parts with the "can-edit" class. Each can-edit section should include its own editor toolbar.

Is it possible to achieve this with Angular?

<ckeditor [editor]="Editor" [data]="data"></ckeditor>

In other words, can I send the entire HTML to CKEditor and have it restrict editing to only the areas with the can-edit class, while providing a toolbar inside each can-edit div instead of a single toolbar at the top?

Here's the HTML content:

const html = `
<div>
    <div>This is not allowed to edit</div>
    <div class="foo">Not editable <div class="can-edit">Content editable</div></div>
    <div class="bar">Not editable <div class="can-edit">Content editable</div></div>
</div>
`;
image
@jon9090 jon9090 added the type:question This issue asks a question (how to...). label May 25, 2024
@jon9090 jon9090 changed the title How to edit only parts of the html and each part will have cdkeditor/toolbar? How to edit only parts of the html and each part will have ckeditor/toolbar? May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question This issue asks a question (how to...).
Projects
None yet
Development

No branches or pull requests

1 participant