R – SharePoint publishing site email encoding/decoding

emailencodepublishingsharepoint

I'm building a SharePoint (MOSS) publishing site for employee information on my company website. I have an employee content type and am using the Contact E-Mail Address site column to store an employee's email address.

Want I'd like is the ability to encode email addresses at runtime to prevent the real email address from being harvested by spammers. This would be decoded when a user clicks the email hyperlink e.g. the following HTML would be sent to the browser:

<a href="javascript:sendEmail('5237952A6F67618E407373772E6063212E6175')">Email Jonny</a>

I already have the javascript methods for encoding/decoding a text value from the meaningless string above, but am not too sure as to how to approach this with SharePoint in mind. I'm thinking a custom control and/or custom J-Query?

Any help would be much appreciated!

Jonny

Best Answer

In the case that you are unable to put the users into AD, a custom field control will give you the ability to include the custom rendering (jquery) you require as well as the ability to enter the data as "normal" text.

The custom field, once defined "just works" wherever you need to display the field.

Given you are thinking of using JQuery, the issue then becomes one of making sure the jquery library is correctly linked whenever you need to us a field of this type.