pull in css class

7 posts, 0 answers
  1. Elliott
    Elliott avatar
    392 posts
    Member since:
    May 2010

    Posted 01 May 2013 Link to this post

    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?
  2. Rumen
    Admin
    Rumen avatar
    13889 posts

    Posted 02 May 2013 Link to this post

    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.
  3. Elliott
    Elliott avatar
    392 posts
    Member since:
    May 2010

    Posted 03 May 2013 Link to this post

    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
  4. Elliott
    Elliott avatar
    392 posts
    Member since:
    May 2010

    Posted 03 May 2013 Link to this post

    adding the css to the html did squatz
    the first image is the page, the second is what the email looks like
  5. Rumen
    Admin
    Rumen avatar
    13889 posts

    Posted 06 May 2013 Link to this post

    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.
  6. Elliott
    Elliott avatar
    392 posts
    Member since:
    May 2010

    Posted 06 May 2013 Link to this post

    "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?
  7. Elliott
    Elliott avatar
    392 posts
    Member since:
    May 2010

    Posted 06 May 2013 Link to this post

    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
     
Back to Top