You are here: Home Plone products zest.emailhider

zest.emailhider (2.6)

1
by Olha Pelishok last modified 2011-11-15
0.0
0.0
0.0
0.0
Released on 2011-11-11 by Zest Software for Plone 3.0, Plone 4.0, Plone 4.1 under GPL - GNU General Public License available for All platforms.
Software development stage: stable
A simple jQuery component for hiding email addresses from spammers.

This package provides a mechanism to hide email addresses with JavaScript. Or actually: with this package you can hide your email addresses by default so they are never in the html; with javascript the addresses are then fetched and displayed.

For every content item in your site you can have exactly one email address, as we look up the email address for an object by its UID. For objects for which you want this you should register a simple adapter to the IMailable interface, so we can ask this adapter for an email attribute and a UID method. The 'emailhider' view is provided to generate the placeholder link.

Objects display a placeholder link with a hidden-email class, a uid rel attribute and a email-uid-<some uid> class set to the UID of an object; when the page is loaded some jQuery is run to make a request for all those links to replace them with a 'mailto' link for that object. Using this mechanism the email address isn't visible in the initial page load, and it requires JavaScript to be seen - so it is much harder for spammers to harvest.

Special case: when the uid contains 'email' or 'address' it is clearly no real uid. In that case we do nothing with the IMailable interface but we try to get a property with this 'uid' from the property sheet of the portal. Main use case is of course the 'email_from_address', but you can add other addresses as well, like 'info_email'. If you want to display the email_from address in for example a static portlet on any page in the site, use this html code:

<a class="hidden-email email-uid-email_from_address"
rel="email_from_address">
Activate JavaScript to see this address.</a>
Document Actions
Powered by Plone