Add uneditable regions to a Template
Add uneditable regions to a Template
This section describes how to create non-editable sections of content in
WYSIWYG mode. For instance, you may wish to prevent the user from changing the
text in a paragraph or table cell.
To make a section of content in the editor unchangable, use these two
attributes: CONTENTEDITABLE and UNSELECTABLE.
Combined, these two attributes prevent a section of HTML, typically a paragraph
or block of text enclosed in DIV or SPAN tags, from being selected and
modified. The section can still be deleted. And, if the user switches to View
As HTML mode, then the content can be changed.
If the item has properties, like table cells, the properties can still be
changed. Add these attributes to content that will be loaded into the editor.
The HTML elements they apply to will appear in the editor, but won't be
editable. Set contenteditable="false" and unselectable="on".
Example:
-
Using your favorite text editor, create a new HTML page and name it
"example1.html".
Open the example1.html file and copy/paste the code below, save it to
/Templates folder.
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="1" width="98%">
<tr>
<td align="right" valign="top" width="20%" bgcolor="#ffff00">
</td>
<td width="15" bgcolor="#ffff00"></td>
<td valign="bottom" width="80%" bgcolor="#ffff00"><div UNSELECTABLE="ON" contenteditable="false">This Heading is not editable.</div></td>
</tr>
<tr>
<td valign="top" width="20%" bgcolor="#ff9900"><strong>SECTION 1</strong><br>
Title 1<br>
Title 2<br>
Title 3<br>
<br>
</font>
</td>
<td width="15" bgcolor="#0033cc"></td>
<td valign="top" width="80%" bgcolor="#0033cc">Lorem ipsum dolor sit amet,
consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut
lacreet dolore magna aliguam erat volutpat.</td>
</tr>
</table>
</center>
</div>
-
Register this template file in the Template Resource file Resources.xml(what's
it?).
<template>
<title>put a title here</title>
<description>This is an example template.</description>
<html>example1.html</html>
</template>