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

[Solved] Problem Formatting FormatBlock Dropdown in radEditor in Sitefinity CMS

1 Answer 216 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 16 Nov 2009, 03:40 PM
I am trying to style items in the FormatBlock dropdown by editing the EditorToolsFile(.xml).  I am following this refernce article: http://www.telerik.com/help/aspnet-ajax/paragraphstyles.html.  It explains that to display the dropdown items with their corresponding formatting, add the tag around the item name.  The example that is given is as follows:
<paragraphs>
    <paragraph name="Clear formatting" value="<body>" />
    <paragraph name="<H1>Heading 1</H1>" value="<H1>" />
    <paragraph name="<H2>Heading 2</H2>" value="<H2>" />
    <paragraph name="<H3>Heading 3</H3>" value="<H3>" />
    <paragraph name="<p class='redStyle'>redStyle</p>" value="<p class='redStyle'>" />
  </paragraphs>


I am receiving an error because the symbol < is not allowed within an xml tag. This is the error:
'<', hexadecimal value 0x3C, is an invalid attribute character.

I have tried using &lt; instead of < and it fixes the error but does not format the item as it should (as a h1 tag).  Am I missing something obvious or does anyone have a fix for this?  Keep in mind this is the radEditor instance used when editing a page in Sitefinity, not just a radEditor thrown on any page.  Thanks in advance for any help.

Ryan

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Nov 2009, 09:47 AM
Hi Ryan,

Yes, the correct XML syntax is to encode the < symbol to &lt;. This entity in the help article is unfortunately converted by the HelpStudio program that we use to write and generate the CHM documents.
You can see how the Paragraph Styles feature of RadEditor works and how to configure it in this live demo: Paragraph Styles.

Could you please try the following configuration and see whether you still experience the problem:

<paragraphs>
<paragraph name="&lt;H1>Heading 1&lt;/H1>" value="&lt;H1>" />
<paragraph name="&lt;H2 style='font-family: Trebuchet MS;'>Heading 2&lt;/H2>" value="&lt;H2 style='font-family: Trebuchet MS;'>" />
<paragraph name="&lt;H3 class='serif'>Heading 3&lt;/H3>" value="&lt;H3 class='serif'>" />
</paragraphs>


Please also send a screenshot of the content in Design and Html mode of RadEditor.

The problem could be due to some global H1, H2, H3 ... css classes on the page with RadEditor that change the default appearance of these tags. The editor automatically picks up the styles from the page and this could be the reason for the problem. To stop this behavior set the CssFiles property to point to some empty css class and test again.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Ryan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or