Setting Default Html Content in RadHtmlField

6 posts, 0 answers
  1. Amal Abeygunawardana
    Amal Abeygunawardana avatar
    1 posts
    Member since:
    Feb 2010

    Posted 24 Jun 2010 Link to this post

    Hi Everyone,

    I tried setting "Html" attribute of "RadHtmlField" to set some default html content when the page layout loads in SharePoint. However, this default value was not set as expected. Following is the code from page layout,

    <telerik:RadHtmlField id="myfieldid" FieldName="myfieldid" runat="server" Html="&lt;h1&gt;my default content &lt;/h1&gt;" >
     </telerik:RadHtmlField>

    Any help to set default content for this field is very much appreciated.

    Thanks & Regards,
    Amal
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 25 Jun 2010 Link to this post

    Hi Amal,

    Could you confirm, which version of RadEditor for MOSS are you using? Knowing this I will be able to give a corresponding sample solution for the problem.


    All the best,
    Stanimir
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  3. Ajay
    Ajay avatar
    4 posts
    Member since:
    Feb 2012

    Posted 17 Feb 2012 Link to this post

    Hi,

    I am using 5.8 RadEditor for MOSS .i not able to set Default Message in RadHtmlField
    Please do the needful ASPA

    Regards
    Ajay
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 20 Feb 2012 Link to this post

    Hello,

    You can achieve the desired functionality on the client side.
    1. Add the following element in the ConfigFile.xml, which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/5.x.x.0__1f131a624888eeed/Resources/ folder:
    <property name="OnClientLoad">OnClientLoad</property>

    2. Add the following javascript code in the MOSSEditorTools.js, which is located in the mentioned above folder:
    function OnClientLoad(editor, args)
    {
        var html = editor.get_html(true);
        if (html.match(/^\s*$/) != null)
            editor.set_html("Default content");
    }




    Greetings,
    Stanimir
    the Telerik team
    Learn how the Telerik controls can be integrated in SharePoint 2007/2010 from this resource. To watch them in action, explore our online SharePoint 2010 and SharePoint 2007 demo sites.
  5. Vishal
    Vishal avatar
    1 posts
    Member since:
    Feb 2012

    Posted 21 Feb 2012 Link to this post

    We have two more queries regarding your response:
    1. On the path mentioned for "ConfigFile.xml" there are 8-10 more files with following naming convention:
        ConfigFile{GUID1}.xml
    ConfigFile{GUID1}.xml
    ConfigFile{GUID2}.xml
    ConfigFile{GUID3}.xml
    ConfigFile{GUID4}.xml
    ConfigFile{GUID5}.xml
    ConfigFile{GUID6}.xml
    ConfigFile{GUID7}.xml
    All the GUID values are different. From where does it get the GUID's?
    Which "ConfigFile.xml"  should we change?

    2. There is one "ConfigFile.xml" and "MOSSEditorTools.js" in "RadEditorMOSS.wsp" which we used to deploy RADEditor. Is it fine if we extract all the files from the wsp, make changes to "ConfigFile.xml" and "MOSSEditorTools.js" and create another .wsp using "makecab" utility? Any piece of advice you would like to suggest?

    Rgds,
    Vishal
  6. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 23 Feb 2012 Link to this post

    Hello,

    1. Regarding the first question review the following online help article: Different configuration files for different webs

    2. There is one "ConfigFile.xml" and "MOSSEditorTools.js" in "RadEditorMOSS.wsp" which we used to deploy RADEditor. Is it fine if we extract all the files from the wsp, make changes to "ConfigFile.xml" and "MOSSEditorTools.js" and create another .wsp using "makecab" utility? Any piece of advice you would like to suggest? -  In order to achieve this you will need some additional files, which we provide on demand. In order to get them open an official support ticket and, if you have valid license credentials I will provide them to you.


    All the best,
    Stanimir
    the Telerik team
    Learn how the Telerik controls can be integrated in SharePoint 2007/2010 from this resource. To watch them in action, explore our online SharePoint 2010 and SharePoint 2007 demo sites.
Back to Top