How to allow rich text editing on summary link description field

by ZebSadiq 24. September 2010 02:26

The Summary Links control is a great way to allow content editors to add links to other content using a simple content editing method. One of the limitations of the Summary Links control is in its ability to allow rich text on the description field of an item.

There is no out of the box way to enable this, however, if you need this, here is a workaround:

Browse to the layouts folder (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS)
Make a copy of  the CmsSlwpAddEditLink.aspx file. You can either rename it or place it under a your own folder e.g. Layouts\MyProject\CmsSlwpAddEditLink.aspx (I’ll assume that you’ve created your own folder).

Open your version of the CmsSlwpAddEditLink.aspx in a text editor. Find the following line of code (should be line number 300).

<wssawc:InputFormTextBox Title="<%$SPHtmlEncodedResources:cms, cmsslwpaddeditlink_description_label%>" class="ms-input ms-slLinkDlg-InputField" ID="descriptionTextBox" Runat="server" TextMode="MultiLine" Rows="4"/>

Change it to:

<wssawc:InputFormTextBox Title="<%$SPHtmlEncodedResources:cms, cmsslwpaddeditlink_description_label%>" class="ms-input ms-slLinkDlg-InputField" ID="descriptionTextBox" Runat="server" TextMode="MultiLine" Rows="4" RichText="True" RichTextMode="FullHtml"/>

This tells the field to allow rich text editing. Next you will need to override the javascript method that calls the out of the box item creation page, and point it to your own version. Insert the following code somewhere at the bottom of your SharePoint page.

function popupAddEditGroupDialog(mode, name, linkid, groups, postBackReference)
{
                if (slwp_enabled)
                {
                                var   dialogUrl=slwp_webUr l+ "/_layouts/MyProject/CmsSlwpAddEditGroup.aspx";
                                dialogUrl+="?Mode="+mode;
                                dialogUrl+="&LinkId="+linkid;
                                var dialogFeatures="resizable: no; status: no; scroll: no; help: no;"+                                                                                                                         "dialogWidth:"+slwpGroupDialogWidth+";"+                                                                                                                      "dialogHeight:"+slwpGroupDialogHeight+";";
                                var dialogArguments=new Object();
                                dialogArguments.mode=mode;
                                dialogArguments.name=name;
                                dialogArguments.availableGroups=groups;
                                slwp_postBackEventReference=postBackReference;
                                commonShowModalDialog(dialogUrl, dialogFeatures, slwpDialogCallback, dialogArguments);
                }
}

Thats it! You will now be allowed to use rich text inside the description field of the summary link creation window.

 

 

 

Tags: , , ,

SharePoint 2007

Comments

03/02/2011 22:30:08 #

Hi there, thank for the share, cool stuff. I ecountered a problem with then RichText format!! The RichText field is there but when you save it, it remain plain, and displays all codes in the fiels e.g. <strong>sometext</strong>.

any suggestion?

Visar Albania | Reply

04/02/2011 05:39:16 #

oh thats wierd. The only thing I can think of which might be different to when I did this is that I was also defining my own custom item style by defining a custom xsl file. If you can, try setting a custom item style xsl file and play with the html thats being output. I think there may be something in the out of the box xsl file that may be stopping the characters from escaping.
Side note: Make sure you reference a xsl file from the style library (uploaded version), else you'll run into security issues. Let me know if that works.

ZebSadiq United Kingdom | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

<<  March 2024  >>
MoTuWeThFrSaSu
26272829123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar