mdev
mdev

Reputation: 43

Disable editing between specified tags in CkEditor

As ur experience, there are any way to do that? For example, i have a default layout, which loads when the user starts editing an empty document, something like this:

<h1>Sample heading</h1>
<p>Sample text</p>
<div class="something"></div>

Here, i want to have a control to prevent ppl starting to writing into the .something div. If possible, i want to disable the possibility to remove my predefined tags too.

Sorry for english, and thanks for the answers! :)

Upvotes: 2

Views: 3839

Answers (2)

Matt Mecham
Matt Mecham

Reputation: 31

For others finding this via search engines.

You can use the contenteditable attribute of HTML within a CKEditor document.

http://docs.cksource.com/CKeditor_3.x/Users_Guide/NonEditable_Contents

Upvotes: 3

Zee
Zee

Reputation: 911

First solution that i can think of is to hook all possible events that manipulate content, create document tree location aware logic and simply intercept and counter events which would edit areas described by your requirements as non-editable.

And im most curious if there is something easier then that.

Upvotes: 2

Related Questions