Domanda

I have a Project Web Access (WSS 3.0) site collection where I can't use the Telerik Rad Editor as a rich text editor (long story). My problem is that my users are accustomed to the Rad Editor's image manager feature that lets them upload images directly to an image library and insert them into a rich text field. Any clever suggestions (like Javascript, jQuery, SPServices, etc.) for working around this? My users will flat out reject the default "upload, copy URL, paste" method that the CEWP requires.

È stato utile?

Soluzione

You can't extend the CEWP, so your only option is to work out RAD, or develop an alternative your self.

James McCormack had a similar issue (needed to extend CEWP).

He used reflector to dig into the CEWP, and took the relevant code, and implemented it in a visual web part solution. His solution is targeted at 2010, but you could use a similiar approach and leverage Jan Tielens SmartPart ( http://smartpart.codeplex.com/ )

You would need to add the relevant code of course to implement an image manager type solution.

Here is the link for James' post: http://zootfroot.blogspot.com/2010/09/develop-custom-editable-visual-web-part.html

This is code for uploading image from Charles Lee

http://www.simple-talk.com/community/blogs/charleslee/archive/2009/10/21/75594.aspx

Dim streamImage As Stream = Nothing 
If fleInput.HasFile Then 
    streamImage = fleInput.PostedFile.InputStream 
End If

Using Site As New SPSite("SITECOLLECTIONURL") 
    Using Web As SPWeb = Site.OpenWeb("SITEURL") 
        Dim pics As SPList = Web.Lists("PICTURELIBRARYNAME") 
        pics.RootFolder.Files.Add( _ 
            fleInput.FileName, streamImage) 
    End Using 
End Using

At this point, you would need to have the full URL path to the image, and inject the tag into your editor.

Altri suggerimenti

I've always been fond of RightJS's RTE. I admit, I haven't implemented it for use with images, but there is a post on SPServices forum that discusses how to handle file uploading. You should be able to extend the RTE to grab files from desktops instead of URL's and send them to the appropriate library.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top