Hi!
Is there any way to keep rad editor from stripping html, head and body tags from a template just added from the template manager?
EDIT:
Extended explanation.
I have a folder with html files I want to use as templates to create new html files. But when I load them using the template manager, all the head section, and the <html> and <body> tags disappear, and so do all the css classes defined inline.
I've noticed that on telerik examples happends the same.
Is there any way to keep all that information instead of being stripped away?
Is there any way to keep rad editor from stripping html, head and body tags from a template just added from the template manager?
EDIT:
Extended explanation.
I have a folder with html files I want to use as templates to create new html files. But when I load them using the template manager, all the head section, and the <html> and <body> tags disappear, and so do all the css classes defined inline.
I've noticed that on telerik examples happends the same.
Is there any way to keep all that information instead of being stripped away?
4 Answers, 1 is accepted
0
Hi Marc,
You can fix this browser problem by overriding the TemplateManager command and manually setting the stripped by the browser HTML, HEAD and BODY tags. Here is an example how to do that:
<telerik:radeditor runat="server" ID="RadEditor1" TemplateManager-ViewPaths="~/" TemplateManager-UploadPaths="~/"></telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["TemplateManager"] = function(commandName, editor, args)
{
var myCallbackFunction = function(sender, args)
{
var resultImageObject = args.Result;
editor.set_Html("<html><head></head><body>" + resultImageObject + "</body></html>")
}
editor.showDialog("TemplateManager", {}, myCallbackFunction);
};
</script>
Kind regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can fix this browser problem by overriding the TemplateManager command and manually setting the stripped by the browser HTML, HEAD and BODY tags. Here is an example how to do that:
<telerik:radeditor runat="server" ID="RadEditor1" TemplateManager-ViewPaths="~/" TemplateManager-UploadPaths="~/"></telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["TemplateManager"] = function(commandName, editor, args)
{
var myCallbackFunction = function(sender, args)
{
var resultImageObject = args.Result;
editor.set_Html("<html><head></head><body>" + resultImageObject + "</body></html>")
}
editor.showDialog("TemplateManager", {}, myCallbackFunction);
};
</script>
Kind regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
garfield
Top achievements
Rank 1
answered on 12 Feb 2008, 03:55 PM
Hi Rumen
I'm sorry but that's not what I was looking for.
I mean... I have my templates folder, and each template has a code meant to be for itself: Inline classes definitions, attributes of the tag... whatever. I just can't create a script for each of them. And of course there's the possibility to upload new templates, so a script is not an option.
I'm including an example:
One of my templates would be something like that
But once I include it by using the template manager, only this code remains
How should I proceed?
Thank you very much
I'm sorry but that's not what I was looking for.
I mean... I have my templates folder, and each template has a code meant to be for itself: Inline classes definitions, attributes of the tag... whatever. I just can't create a script for each of them. And of course there's the possibility to upload new templates, so a script is not an option.
I'm including an example:
One of my templates would be something like that
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<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> |
But once I include it by using the template manager, only this code remains
<TABLE cellSpacing=0 cellPadding=0 width=402 align=center border=0> |
<TR> |
<TD>Contents</TD> |
</TR> |
</TABLE> |
How should I proceed?
Thank you very much
0
Hi,
By default, the IE strips the HTML, HEAD and BODY tags. To fix the problem set a simple entity before the <HTML> tag. After that when you insert the HTML file through the Template manager, the LINK and STYLE tags will be not stripped.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<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
By default, the IE strips the HTML, HEAD and BODY tags. To fix the problem set a simple entity before the <HTML> tag. After that when you insert the HTML file through the Template manager, the LINK and STYLE tags will be not stripped.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<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
Scott Allen
Top achievements
Rank 1
answered on 16 Apr 2010, 03:26 PM
Thanks! Just saved me a lot of time.