Use ImageManager for RichImageField in MOSS

2 posts, 0 answers
  1. IT Department
    IT Department avatar
    21 posts
    Member since:
    Apr 2007

    Posted 21 Sep 2009 Link to this post

    Hi all,

    I know that Telerik earlier have stated that there is no support using the RadEditor's ImageManager for handling images in the MOSS' RichImageField.
    There is one way you can do this, by visiting this thread you can see how (requires login):
    http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx

    But the downside of this solution is the need of code-behind. My page layout is as of this date code-behind free, and I would like to keep it this way.
    So I tested using the RadHtmlField inplace of the RichImageField in my page layout. I also created a new ToolsFile.xml and ConfigFile.xml (called ImageToolsFile.xml and ImageConfigFile.xml) and referenced these in the page layout:

    <radE:RadHtmlField ToolsFile="/_wpresources/RadEditorSharePoint/5.5.1.0__1f131a624888eeed/Resources/ImageToolsFile.xml" 
                        ConfigFile="/_wpresources/RadEditorSharePoint/5.5.1.0__1f131a624888eeed/Resources/ImageConfigFile.xml" id="ContentQueryImage" FieldName="PublishingRollupImage" AllowHyperLinks="false" runat="server"/> 
     

    Here are the contents of the two custom xml files:
    ImageConfigFile.xml:

    <?xml version="1.0" encoding="utf-8" ?> 
    <configuration> 
        <property name="ToolbarMode">ShowOnFocus</property> 
        <property name="ToolsWidth">200px</property> 
    </configuration> 

    ImageToolsFile.xml

    <?xml version="1.0" encoding="utf-8" ?> 
    <root> 
      <modules> 
          <module name="RadEditorDomInspector" /> 
      </modules> 
      <tools name="InsertToolbar" > 
        <tool name="ImageManager" shortcut="CTRL+G"/> 
      </tools> 
     
      <contextMenus> 
        <contextMenu forElement="IMG"
          <tool Name="SetImageProperties" /> 
          <tool Name="ImageMapDialog" /> 
        </contextMenu> 
      </contextMenus> 
    </root> 

    The only thing enabled in the ImageToolsFile.xml file is the ImageManager. So far, everything works as expected. I click on the ImageManager icon in the toolbar, upload a new image, select the image, and the image gets inserted into the editor.
    I save the page, and go back to the site's front page (default.aspx), and the rollup image is displayed as expected.

    The trouble begins when trying to edit the page. I go back into the page, and click Edit page. I then get the following error:

    Failed to set value of the "Rollup Image" column on the "Publishing Image" field type control.  See details in log. Exception message: Unable to cast object of type 'Microsoft.SharePoint.Publishing.Fields.ImageFieldValue' to type 'System.String'..

    So to summarize: It seems to me that there is some kind of implicit casting when saving the image information, but not when loading it when viewing or editing the page.
    Does someone have a fix for this, or maybe Telerik can put this on the winshlist for the next version? :-)

    Thanks!
    Frank



  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 22 Sep 2009 Link to this post

    Hello Frankok,

    The scenarios that RadEditor for MOSS supports are WCM (enabled as a feature or replacing the tag of the default editor in the SharePoint designer), web part and list (list, wiki, blog ...). You can not use the RadEditor for MOSS for handling images in the MOSS' RichImageField.

    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Back to Top