Welcome Guest Search | Active Topics | Sign In | Register

HTML Editor Templates Editable UnEditable Regions? Options
Pointeman
Posted: Monday, March 2, 2009 4:50:02 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Q. Does the HTML Editor support templates to allow or disallow certain HTML regions?

eo_support
Posted: Monday, March 2, 2009 5:13:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

No. Unfortunately you can not do that. You may be able to do that indirectly with an image. The basic idea is to replace the non-editable blocks in your your HTML contents with an image (or a single DIV element with certain CSS styles) before you load the HTML in the editor. User will be able to add/remove/move these images (non-editable blocks), but they will not be able to change anything "in" it because it's a single element and there is nothing in it. Once user completes editing, you would then replace your non-editing block back to its original contents.

Thanks
Pointeman
Posted: Monday, March 2, 2009 5:49:20 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Okay, do you think this method will work:

<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="1" width="98%">
<tr>
<td align="right" valign="top" width="20%" bgcolor="#ffff00">&nbsp;
</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>


Q. Is there anyway to disable the "HTML View" selector/button on the bottom/left of the editor?

This would prevent users from editing-out certain html regions as well.
eo_support
Posted: Monday, March 2, 2009 7:11:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your HTML works on IE but not FireFox. I believe contenteditable is originally IE only, FireFox 3 added support for that, for earlier versions, there was a designMode to make the whole document editable/non-editable and it can not be set on individual element level.

To disable HTML View, you would clear HtmlTabButtonText property.

Thanks!

Pointeman
Posted: Wednesday, March 4, 2009 1:51:15 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Okay, I'm learning. Thanks for the HTML button info. I have another question concerning templating.

Q. Is there an event (OnClick, etc..) I can use when the 'add image' button is used?

Problem: I need to strip the images 'width' and 'height' attributes from the automatically created html. I have users with images quite large and I cannot override thier image sizes using CSS alone.

eo_support
Posted: Wednesday, March 4, 2009 2:22:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Unfortunately there isn't such an event. Your best option might be adding/striping width/height when user saves the contents. If they choose to add a huge image, they will see a big image while they are editing it. However it will be adjusted when they save it. That way they may understand what happens much better than if you were to doing it while they insert it.

Thanks!
Pointeman
Posted: Wednesday, March 4, 2009 6:01:06 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Okay, here's the real issue: the HTML Editor doesn't seem to only load and save html existing between <body>...>/body>. So the style attributes I coded into the head of the template never had any effect. I moved the style attributes to the apps main stylsheet and now the img style tag overrides any width and height tag.

Q. Why does your HTML Editor only load the <body> content?

I still need to use the <head> tags so the <table> border: Dashed 1px Black; attributes work when the Editor loads the saved html from the DB. This way the user can see where the tables and cells are located.

eo_support
Posted: Wednesday, March 4, 2009 7:25:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

No HTML Editor will load head section for you. The editor is meant to be used to edit HTML blocks, not HTML file. In order to set styles to be used by the editor, you would usually put the style into a separate .css file and then set the editor's TextAreaCssFile property:

http://doc.essentialobjects.com/library/1/editor/styles.aspx

Thanks!
Pointeman
Posted: Wednesday, March 4, 2009 9:10:43 PM
Rank: Advanced Member
Groups: Member

Joined: 2/27/2009
Posts: 41
Thank you for excellent support, case closed if no objections. Thanks again...


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.