Changing the default behavior for Image Alignment

4 posts, 0 answers
  1. SteadyRain Developer
    SteadyRain Developer avatar
    16 posts
    Member since:
    Apr 2010

    Posted 07 Sep 2011 Link to this post

    Currently, if you use the RadEditor to align an image to the left or right of content, the editor proceeds to add the following code to the image tag:

    style="float: left;

    We would like the default behavior for image alignment to instead add the following code to the image tag:

    align="left"

    I've tried turning off filters such as "ConvertToXhtml" but the float style still gets inserted.

    Can anyone tell me if this change is possible?

    Thanks in advance.
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 08 Sep 2011 Link to this post

    Hi Joe,

    RadEditor offers a built-in content filter that converts the inline CSS to corresponding HTML attributes, which is disabled by default. To achieve this functionality you need to enable the filter using the following code:
    RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.ConvertInlineStylesToAttributes);

    More information regarding RadEditor's built-in content filters is available in the following live demo:
    Editor / Built-in Content Filters

    Best wishes,
    Dobromir
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. SteadyRain Developer
    SteadyRain Developer avatar
    16 posts
    Member since:
    Apr 2010

    Posted 22 Sep 2011 Link to this post

    Can you tell me what version of the RadEditor DLL supports the ConvertInlineStylesToAttributes filter?

    From what I'm working on, I can tell that the Telerik.Web.UI.dll Version 2010.3.1317.35 does not support that filter, nor does the 2011.1.519.35 version.

    Please advise.

    Thank you
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 Sep 2011 Link to this post

    Hi Joe,

    The ConvertInlineStylesToAttributes filter was introduced in RadControls for ASP.NET AJAX Q2 2011 (ver 2011.2.712).

    Regards,
    Dobromir
    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
Back to Top