Add new accepted protocol to URL/link validation i

2019-07-16 19:12发布

问题:

I am trying to add a hyperlink in the content editor in sharepoint 2010. The problem is that the validation only allows certain accepted protocols (http, https, ftp, mailto, news, etc..). I need to add Lotus Notes link such as this: "notes://mydomain".

I found a few pages that had some solutions for SharePoint 2007, but they did not work for me.

  • Allowing alternate protocols to be entered in link fields
  • how to insert notes:// link?

My hope is that SP2010 addresses a way of getting around this issue. Any help would be greatly appreciated.

回答1:

You can insert a script editor web part and type the <a href=''>link</a> manually



回答2:

Unfortunately I did not find a good solution, in my opinion. I really wanted to be able to modify some setting in SharePoint and allow other protocols. I went as far as trying to override the IsSafeHref() in core.js, but no luck. My final solution was to create a WebPart that reads the querystring and calls a redirect. Like so:

protected void Page_Load(object sender, EventArgs e)
{
   string url = System.Web.HttpContext.Current.Request.QueryString["url"];

   if (!string.IsNullOrEmpty(url))
   {
       Response.Redirect(url);
   }
}

Hope it helps others out there.



回答3:

I made it as simple as the following using OOB without SP Designer:

  1. insert a "Content Editor" or "HTML Form" Web Part
  2. Click on Edit page
  3. Click inside the web part
  4. Click on insert from the top
  5. Select Link, From Address
  6. Type the text you need then type the link to Lotus "notes://server name/????"

To make it looks as 1 line you can select the value "none" for web part Chrome Type in the Appearance.