This is a migrated thread and some comments may be shown as answers.

Newsletter Editor

3 Answers 170 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Apr 2008, 04:28 PM
I'm trying to use the editor to create/edit html newsletters and I'm not quite figuring how to do this-

- starting with an html page from Template Manager the editor strips my html/head/body/style tags.  I saw, somewhere, that adding " " to the beginning of the file would prevent this.. though it doesn't  seem to work.
How can I do this?

Any other tips for editing the templates, setting editable/non-editable areas, or other thoughts would be appreciated.

Thanks :-)
David

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 28 Apr 2008, 12:41 PM
Hi David,

Please, try the following code which provides a solution for this browser stripping behavior:

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript">
function OnClientPasteHtml(sender, args)
{
    var commandName = args.get_commandName();
    var value = args.get_value();
   
    if (commandName == "TemplateManager")
    {
        sender.set_html("<html><head></head><body>" + value + "</body></html>");
    }
       
    //Cancel the event if you want to prevent pasteHtml to execute
     args.set_cancel(true);
}
</script>

<telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="OnClientPasteHtml">
    <TemplateManager ViewPaths="~/" UploadPaths="~/" />
</telerik:RadEditor>


Here is the HTML file content:

&nbsp;
<HTML>
  <HEAD>
    <TITLE>title</TITLE>
    <link href="_stilos.css" rel="stylesheet" type="text/css">
    <STYLE type=text/css>.Estilo2 { COLOR: #333333 } </STYLE>
  </HEAD>
 
  <BODY text=#000000 vLink=#0000ff aLink=#0000ff link=#0000ff bgColor=#ffffff 
  leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
 
    <TABLE cellSpacing=0 cellPadding=0 width=402 align=center border=0>
      <TR>
        <TD>Contents</TD>
      </TR>
    </TABLE>
 
  </BODY>
</HTML>

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
David
Top achievements
Rank 1
answered on 18 May 2008, 04:53 PM
Thanks for the reply.

I've decided that templates will be loaded in editor, on page load, then via RadCombo selection and ajax callbacks to server methods. 
Of course, I need all actions in this scenario to maintain the full html code.

Whenever a template is loaded only the HTML tags are stripped.  Adding the &nbsp; to the beginning makes no difference.

When is this being stripped, and how can I prevent it?

Thanks!
David
0
Rumen
Telerik team
answered on 20 May 2008, 10:48 AM
Hi David,

Could you please open a support ticket and send us a sample running example demonstrating your specific scenario and the problem? Please, include steps to reproduce the problem and sample content. We will examine your code and provide the best possible solution for this browser related problem.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
David
Top achievements
Rank 1
Answers by
Rumen
Telerik team
David
Top achievements
Rank 1
Share this question
or