making a phone number a clickable link
Thanks,
Ray Porter
Comments
-
I suspect you could do it with a UI Model but I've never tried... wrapping an anchor tag around the telephone output. Ie,..... <a href="tel:800-555-1212">800-555-1212</a>
Side note. Blackbaud needs to update their "Insert Link" dialog boxes for email and html content. Remove gpher news telnet and wais from the link type dropdown and add "tel:"
wais? gopher? What the heck? Is this 1992?1 -
now that I think a little more about this, I don't really think it could be done without using a bunch of javascript and/or a UI Model....1
-
Hi Rick,
Unless someone can tell me something different, I've come to pretty much the same conclusion. I think you'd need a UI model to get the HTML snippet to link the JS code. I don't think CLR code would help. I've found several examples that implement this functionality for regular HTML pages but nothing with CRM forms and the corresponding HTML snippet. I guess is they want to move ahead with this, I'll have to try and adapt some of the JS I've found. This would be so much simpler if BB just added a "Telephone" data type to the field drop-down in the data form XML.
Thanks,
Ray1 -
1
-
[Note from Joseph Styons: I updated this post to handle more than one phone #, which the prior example didn't do well]
Hi Ray,
The below steps worked for me:
1 - Extend the OOB “phone view form” with a view form extension (just a dummy or placeholder field is enough)
2 - put a ui model on that extension. be sure to include an HTML file
3 - In the HTML file, add this to the very bottom of the file (change the path according to your preferences):
<!--SCRIPT:/browser/htmlforms/custom/PhoneViewFormExtension.js-->
4 - Create that JS file
5 - Put the following code in it (I've added comments to every line)
In case the JSFiddle goes away, here is the same code (but not as nicely formatted)
(function (f) {
f.on(
{
render: function () {
//get the OOB phone # field(s). if they have viewed > 1, then this will have > 1 entry.
var phonenumberfields = $('[id$=PHONENUMBER_value]');//they could have many phone #s in the DOM at this time (by expanding & collapsing many detail view forms).
//scan through them all, and perform they 'hyperlink-ing' operation on any you can get your hands on.
for (var i = 0; i < phonenumberfields.length; ++i) {
var currentID = phonenumberfields[i].id;//grab the actual phone number out of that field
var phoneNumber = document.getElementById(currentID).innerHTML;//turn the phone # into a hyperlink format (just add tel:)
var telHref = 'tel:' + phoneNumber;
//have we already created a hyperlink for this #?
var alreadyExists = (document.querySelectorAll("a[href='" + telHref + "']").length > 0);
if (!alreadyExists) {//create a custom hyperlink
var phoneHyperlink = document.createElement('a');//push the "real" phone number into our custom phone link
phoneHyperlink.textContent = phoneNumber;//turn it into a proper TEL: link (not just a regular hyperlink)
phoneHyperlink.href = telHref;//now move the new hyperlink immediately after the OOB field
$(phoneHyperlink).insertAfter($('#' + currentID));//finally, hide the OOB field, leaving just our custom one
$('#' + currentID).hide();
}
}
}
})
})();I hope this helps!
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 941 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)


