You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
  Friday, 20 May 2022
  2 Replies
  220 Visits
I'm wondering if there is way to prevent a JCE Editor user from deleting specific bits of html.

Let's say that every Article has this div: <div class"something"> the user puts content here </div>

Right now the user can backspace over that opening div tag when working visually and not even be aware they removed the div tag. Doing so removes all the formatting provided by the "something" class.

I only want the user to be able to edit the content between the div tags but not edit or delete the div tags.

Any suggestions?
more than a month ago
·
#111090
You can use the "mceNonEditable" and "mceEditable" classes to make elements non-editable and editable respectively. So in your instance, you might use:


<div class="something mceNonEditable">
<div class="mceEditable">
<!-- User Content -->
</div>
</div>

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#111092
Ensure that the NonEditable option is checked in Editor Profiles -> Features & Layout -> Additional Features

The mceNonEditable and mceEditable class names can be changed in Editor Profiles -> Plugin Parameters -> NonEditable, to something more suitable tou your needs if required.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!