Add new accepted protocol to URL/link validation in SharePoint 2010

自作多情 提交于 2020-01-24 19:10:10

问题


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.



来源:https://stackoverflow.com/questions/5780738/add-new-accepted-protocol-to-url-link-validation-in-sharepoint-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!