Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, May 10, 2012 10:51 AM
Hi,
This is something I've been trying to do for quite a while now. I've found no definitive answer having seen other similar questions asked. One example here - http://admrl.it/IVKJKd.
Although we are using Lync this isn't relevant to this particular question. What I'd like to achieve is click-to-dial links in SharePoint using the format "tel:+447825555123". This works perfectly fine in regular HTML. When you try to add this as a link in SharePoint you get the following validation error:
So I used SharePoint designer to create the hyperlink which worked fine as there isn't the same validation in place. Once the page was saved back I checked the underlying HTML and SharePoint strips the link out just leaving <a>+447825555123</a> instead of what is should be <a href="tel:+447825555123">+447825555123</a>. I tried setting the link by editing the HTML and SharePoint strips it just the same.
Does anyone know a way around this? The best solution I think would be to edit the SharePoint validation so can add tel links through the regular edit option. I'm not sure how this is achieved though. This is in a SharePoint 2010 wiki btw.
Thanks,
PP
All replies (9)
Friday, May 11, 2012 9:04 AM ✅Answered | 1 vote
Hi Pete,
I managed to test this out yesterday on my dev box, here's what I did:
1. Open notepad and create the tel link <a href="tel:0123456789">My Number</a>, save as text file (in my case tel.txt).
2. Open SharePoint and navigate to a doc library, upload text file from step 1.
3. Open a page and get it in edit mode, drop in a content editor web part, edit webpart settings and you will get a input box to enter the path to content.
4. Enter /%doclibname%/tel.txt, change the chrome of the web part so you only see the link, not the webpart title etc.
5. Save the page and you now have your tel link without SharePoint messing with your markup.
HTH
-Paul
Paul Barton | SharePoint Consultant | MCITP SharePoint 2010 Administration | MCTS WSS 3.0 / MOSS 2007 | My Blog | Follow Me on Twitter
Friday, May 11, 2012 9:17 AM ✅Answered
Create your own custom field type for this: http://msdn.microsoft.com/en-us/library/ms446361.aspx
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
Thursday, May 10, 2012 11:28 AM
I don't think you'll get an easy solution for this. I tried to get Sharepoint working with another custom link we're using but sharepoint always damages the link. As I read this is for security reasons.
Thursday, May 10, 2012 3:05 PM
Hi Peter,
I've not tested this but you could try creating your markup in a text file, save it to a doc library in SharePoint then link to it with a Content Editor web part.
-Paul
Paul Barton | SharePoint Consultant | MCITP SharePoint 2010 Administration | MCTS WSS 3.0 / MOSS 2007 | My Blog | Follow Me on Twitter
Friday, May 11, 2012 8:56 AM
I've tried to modify this method but adapted it for a "tel:" link to no avail - http://admrl.it/JkLTfB
Paul - I don't quite follow how that would be done. Any guides online I can follow?
Thanks,
Pete
Friday, May 11, 2012 11:03 PM
I am not sure why you using hyperlink but if you use the correct format and you have MS Lync it will automatically connect once you click on it. Try using a regular column and give phone # in this format
Thursday, October 8, 2015 7:54 PM | 1 vote
Here's how to do it in jQuery:
var pattern = /^\(*\+*[1-9]{0,3}\)*-*[1-9]{0,3}[-. /]*\(*[2-9]\d{2}\)*[-. /]*\d{3}[-. /]*\d{4} *e*x*t*\.* *\d{0,4}$/;
var reg = new RegExp(pattern);
$('a').each(function(){
var html = $(this).html();
if(reg.test(html) === true){
var href = 'tel:' + html.replace(/\D+/g, '');
$(this).attr('href', href);
}
}
);
Tuesday, July 4, 2017 9:06 AM
I found adding a script editor webpart and the standard tel hyperlink worked inside the script editor.
Thursday, October 26, 2017 4:32 PM
MikeSoriano:
Your jQuery solution is awesome! Way easier than creating a text file and placing a webpart. Then you just need to place <a> </a> around each phone number and you're done!
Thanks!