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

pull in css class

6 Answers 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 01 May 2013, 05:40 PM
I am using a RadEditor to enable a (pretty unsophisticated) user to generate emails
I have Removed a number of the icons ("tools") that she won't know what to do with i.e. html validator
but I think she will want to incorporate the css she provided us with the site the page is part of
the css renders on the page but when I write the content of the control this is what I get
<span class="navigation">first line<br />
</span><span class="body_text_Heading">second line<br />
</span><span class="main">third line<br />
</span>and an image<br />
<img alt="" src="cid:UniqueID1" />
what do I have to do to get her css into the emails - and how do I tell she has added css styling to her text?

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 May 2013, 12:46 PM
Hello,

Please, see the following articles, which explain how to populate the Apply Class dropdown with the desired CSS classes:

You can also test the online demo: Adding CSS Files to Content Area.

You can instruct your end-user(s) to read the End-User Manual of RadEditor for more information on how the Apply Class dropdown works.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Elliott
Top achievements
Rank 2
answered on 03 May 2013, 12:48 PM
Rumen - the css class appears in the drop down - just not in the content
<head id="hdHead" runat="server">
    <title>Show Badge Request Form - Custom Email</title>
    <link href="MDE2010.css" rel="stylesheet" type="text/css" />
</head>

I'll take it out of the Head tag and put it in the control itself and see if that does anything
0
Elliott
Top achievements
Rank 2
answered on 03 May 2013, 05:03 PM
adding the css to the html did squatz
the first image is the page, the second is what the email looks like
0
Rumen
Telerik team
answered on 06 May 2013, 11:57 AM
Hello,

If you import the CSS file via a link tag in the head of the page, do not set the CssFiles property. If the CssFiles property is not set the editor will automatically read the page styles and will populate them in the Apply Class dropdown as well as apply them to its content area.

Of course you should apply the same link tag to the e-mail content.

Greetings,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Elliott
Top achievements
Rank 2
answered on 06 May 2013, 02:14 PM
"you should apply the same link tag to the e-mail content."

I tried that - and still no styling on the email
- do I have to actually read through the style sheet file, isolate the styles used and pump the styles in stream

um, any code available - and is there an event on the styles selected to indicate css styling is used?
0
Elliott
Top achievements
Rank 2
answered on 06 May 2013, 09:02 PM
here's what worked

I braketed the content with <root> html tags and loaded the content into an XML document
I used XPath to go through the document looking for all <span> elements with a class attribute
I loaded the value of the attribute into a sorted list of CSS classes used

I then grabbed some kode off the Internet which loaded CSS styles into a dropdown - and modified it to return the style content of the sorted list - iterate through the sorted list of styles, match to an array built and build a string
the entire string is bracketed with a <style> tag and put in front of any text from the editor
 
Tags
Editor
Asked by
Elliott
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Elliott
Top achievements
Rank 2
Share this question
or