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

Font size in editor different than page

6 Answers 73 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alva
Top achievements
Rank 1
Alva asked on 12 Oct 2010, 11:24 PM
I created a page for our internal site that uses the editor.   The end users are allowed to use this editor to add content to the site.  The problem is that when the content is in the editor the fonts appear much larger than when the content is displayed on the view page.  The view page is a totally seperate page from the editor page.

I looked at the HTML and the code is different between the two.  The editor uses <style> tags and the resulting html has <FONT> tags.

Is there some option I should be setting to get the output from the editor to use <style> tags?

Thank you

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Oct 2010, 12:35 PM
Hello Alva,

You can see how to apply the default font setting for the content area in this article: Default Font for Editable Content.

In addition the ConvertFontToSpan filter converts all <font> to <span> tags when switching to HTML mode or submitting the content. You should make sure that this filter is enabled.

Greetings,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alva
Top achievements
Rank 1
answered on 13 Oct 2010, 04:11 PM
OK,

I set up the editor like this:

 

<telerik:RadEditor Runat="server" ContentFilters="ConvertFontToSpan"

 

 

OnClientLoad="OnClientLoad" Width="515px" Height="600px" ID="edtHelpContent"

 

 

OnClientCommandExecuted="OnClientCommandExecuted"

 

 

>

 


And created new content.   When I displayed the new content in a web page this is the HTML code behind:
<span id="ctl00_ContentPlaceHolder1_lblHelpContent">This is new content in default font.<BR><FONT size=6>This is size 6<BR></FONT><FONT size=2 face="Courier New">This is courier size 2<BR></FONT><BR></span>

My impression of the ConvertFontToSpan was that it would replace the <FONT> tags in the above with <span> tags, which I think would work perfectly.

Am I missing something or misunderstanding something? 

Thanks for the help in advance.
0
Rumen
Telerik team
answered on 13 Oct 2010, 04:16 PM
Hello Alva,

Please, set

ContentFilters="ConvertFontToSpan,ConvertToXhtml"

or

ContentFilters="DefaultFilters"

Sincerely yours,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alva
Top achievements
Rank 1
answered on 13 Oct 2010, 05:27 PM
I tried both of those and still have the <FONT> tags.  Right now I have:
<telerik:RadEditor Runat="server" ContentFilters="ConvertFontToSpan,ConvertToXhtml" OnClientLoad="OnClientLoad" Width="515px" Height="600px" ID="edtHelpContent"  OnClientCommandExecuted="OnClientCommandExecuted" >
  <CssFiles>   <telerik:EditorCssFile Value="~/css/EditorContentArea.css" /> </CssFiles> <Tools <telerik:EditorToolGroup>      ... Bunch of tools defined....  </telerik:EditorToolGroup> </Tools> <Content> </Content> </telerik:RadEditor>

 

 

and I get the content from the editor in javascript routine like this:
var content = $find('<%=edtHelpContent.ClientID %>').get_html();

The resultant content var has <FONT> tags.

Thanks for any additional input on this issue.

 

 

 

 

 

0
Rumen Jekov
Top achievements
Rank 1
answered on 13 Oct 2010, 07:57 PM
Hi,

You should obtain the content by setting the true parameter of the get_html(true) function, e.g.

var content = $find('<%=edtHelpContent.ClientID %>').get_html(true);

Regards,
Rumen
0
Alva
Top achievements
Rank 1
answered on 13 Oct 2010, 09:00 PM
Thanks man!  That fixed it.
Tags
Editor
Asked by
Alva
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Alva
Top achievements
Rank 1
Rumen Jekov
Top achievements
Rank 1
Share this question
or