I have a view that returns, among other things, email addresses using the SpamSpan display format. However, long email addresses make the view look really ugly. For the mailto link title, I'd like to either use a trimmed email address (i.e. "my_long_email...@example.org"), or static title (i.e. "Email me"). Is this possible?

Comments

gpk’s picture

You might have to do some fiddling in Views to first of all to de/reconstruct the email address link e.g. rewriting the displayed text to "Email me" or truncating it. Views does provide facilities for doing this sort of thing; however you might need something like Views Custom Field to get the exact behaviour you want.

Once you've messed with the email address link to your heart's content you can then let the Spamspan display format do its stuff.

peterx’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

This request is outside the scope of this module. Another module or code can create the modified link then call the spamspan() function.

You could construct anything you want without Spamspan. There is flexible link rewriting in Views 3. There is also a module to let you use PHP in views.

To make Spamspan Javascript respond to your manual link, make sure you end up with a span with class spamspan because the Spamspan Javascript look for span.spamspan. Read the spamspan Javascript to see everything the Javascript requires.