While working on my latest Drupal project, I really wanted an easy, brainless way for users to create clickable “mailto:” links that gave pesky spam-bots a hard time.
Turns out, the Bbcode module does just the trick. Even if you don’t normally use it, you can add this input filter to your standard HTML filters, and it will work. The first step is to download and install the module.
Next up, enable the module, and add it to your input filters (located at /admin/settings/filters):

As you can see, you don’t even need to assign it any roles. However, the Filtered HTML and Full HTML filters can use it, just set them up like so:

Next, go in and and configure the Bbcode module to encode email addresses:

Now, to use it - just use the standard bbcode to encode any email address:
[email]someone@domain.com[/email]
And when the page is rendered, the underlying HTML will all be JavaScript gobbly-gook, but to the end user, it will be a normal link.
Leave a comment