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

Inserting image to float right

4 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Stacy
Top achievements
Rank 1
Stacy asked on 21 Oct 2008, 11:30 PM
When I try to insert an image fromt he ImageManager, it comes back with <p><a href...></p> around it.  I would like to make this always come back as a <div style="float:right"><a href...></div>. 

Is there a way to make this happen?

Thanks!
Stacy

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Oct 2008, 07:28 AM
Hi Stacy,

The images inserted from the Image Manager are standard <img> tags but not <a> tags.

If you would like to wrap the inserted <img> tag in a <div style="float:right></div> tag then you should attach to the OnClientPasteHtml event of RadEditor.

The OnClientPasteHtml event is useful in scenarios where the developers need to examine or modify the HTML to be pasted by an editor tool before it is inserted in the editor content area. Some common cases where the event can be used are:

  • Check whether user specified alt attribute for an image
  • Make modifications to a table being inserted (e.g. set a specific classname, etc)
  • Examine or modify a link before it is inserted


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stacy
Top achievements
Rank 1
answered on 22 Oct 2008, 08:01 PM
Thanks!  This helped me with the solution.
0
pmckay
Top achievements
Rank 1
answered on 24 Mar 2009, 09:18 PM
Hello ,

How would I attach this event  ( OnClientPasteHtml event ) to any RadEditor used in the context of Sharepoint or WSS.

For instance this editor could appear on any page and the NewForm.aspx pages also

Thank you,
/Samir
0
Stanimir
Telerik team
answered on 25 Mar 2009, 08:13 AM
Hello Peter,

I am assuming that you are using the RadEditor for MOSS control. In order to attach to the OnClientPasteHtml event you need to do the following steps.

1. Modify the respective ConfigFile.xml (ListConfigFile.xml), which is located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.2.0__1f131a624888eeed\Resources folder (5.3.2.0__1f131a624888eeed depends on the version of the RadEditor for MOSS).
Add this code.
<property name="OnClientPasteHtml">OnClientPasteHtml</property> 


2. Add your javascript code in the MOSSEditorTools.js file, which is located in the mentioned above folder.
function OnClientPasteHtml(editor, args) 
    //here is your code 

I hope this helps.


Greetings,
Stanimir
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Stacy
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Stacy
Top achievements
Rank 1
pmckay
Top achievements
Rank 1
Stanimir
Telerik team
Share this question
or