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

[Solved] Editor content changing

3 Answers 126 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael Pullella
Top achievements
Rank 1
Michael Pullella asked on 29 Jan 2010, 12:35 PM
Hi

Should the editor ever change the content from something like this:
 "This is the name of an <actor type='test'>Actor</actor> and this is the name of <movie>Movie</movie>"

 


to this:
"This is the name of an <actor type=\"test\" />Actor and this is the name of <movie />Movie"

This is happening in my current project, however, I created a second test project and do not see that behavior exibited. 

In both projects I am setting the content with a button (the real project is in an XMLHttpPanel, the test one is just using a normal postback).  If I look at the content in both projects after the load, they are both set correctly.

I then retrieve the content using a second button (again, real one is doing a partial page postback), the test one is doing a normal postback, and if I look at the content from the real project, it changes to <actor type="\test\"/> while the test project correclty shows <actor type='test'>Actor</actor>..

I copied the radeditor from the real project to the test one, except for the toolsfile, to ensure that there wasn't something set on the editor which might be causing this. 

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Feb 2010, 02:07 PM
Hi Michael,

RadEditor is an XHTML/HTML editor but not an XML editor and its ConvertToXhtml filter does not support XML tags.

In order to solve the problem you can either disable the ConvertToXhtml filter, e.g.

RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);

OR set namespaces for your custom tags, e.g.

"This is the name of an <my:actor type='test'>Actor</my:actor> and this is the name of <my:movie>Movie</my:movie>"

Best regards,
Rumen
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Michael Pullella
Top achievements
Rank 1
answered on 09 Feb 2010, 06:03 PM
Thank you Rumen.

So, is it possible to define a style for my custom tag?
For example, I would like to have all of "my actors" highlighted in yellow.

"This is the name of an <my:actor type='test'>Actor</my:actor> and this is the name of <my:movie>Movie</my:movie>"

I tried defining a style in the header like this:
    <style type="text/css">  
        my:actor
        {  
            background-color:Yellow;  
        }  
    </style> 
but the word Actor does not get highlighted in yellow.

I also tried turning off the XHTML filter, and applying a style, but that also did not pick up the style:
    <style type="text/css">  
        subject   
        {  
            background-color:Yellow;  
        }  
    </style> 
and my Content looks like:
This is the name of the <subject>subject</subject>

I can change the style of a "built in element" like h2, but I need to be able to change the style for my custom elements.  Is this possible?
0
Rumen
Telerik team
answered on 10 Feb 2010, 10:33 AM
Hi Michael,

I was able to highlight the custom tag using a class selector, e.g.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    .test { background-color:Yellow; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadEditor ID="RadEditor1" runat="server">
            <Content>
                 <my:actor type='test' class="test">Actor</my:actor>
            </Content>
        </telerik:RadEditor>
  
    </form>
</body>
</html>


Kind regards,
Rumen
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Editor
Asked by
Michael Pullella
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Michael Pullella
Top achievements
Rank 1
Share this question
or