Enable email cloaking

More
27 Nov 2011 22:50 - 06 Aug 2016 10:58 #1 by Demis [Fox-Labs]
Demis [Fox-Labs] created the topic: Enable email cloaking

Update as of August, 2016

The guide below, applies to Joomla 3.6.1 and older versions.
Joomla 3.6.2 and newer versions contains our Fix which makes all the workarounds unnecessary.
Given that you have the latest version of Fox Contact, on Joomla 3.6.2 and above you don't have to worry about any of the issues described: simply enable the Email Cloak plugin if you want, and get the email cloaked everywhere, even in the form.



Why emailcloak plugin doesn't work by default?

Email cloaking plugin is intentionally disabled in Fox Contact, regardless it's being used as a component, a module, or called inside an article by "Content Load Modules" plugin.
Moreover, when called using {loadposition}, it will results in email cloak disabled for the whole article that embeds the Fox Contact module itself.
This is a "design" problem. Not a Fox contact nor a Joomla specific problem.


Additional Information

Let's suppose that email cloaking plugin was enabled. Imagine you are about to fill out the form, and you write an incorrect captcha code, or you forget a mandatory field, for example "your name".


After your submission, you probably don't expect to fill out the whole form again.
For that reason, valid data are automatically written into corresponding fields, focusing your attention on the wrong data, but although the email address was good, it is turned into javascript code by "Joomla Email cloaking plugin", because it doesn't distinguishes between text inside and outside fields.


There are different approach methods to this problem. I chose to disable email cloaking plugin when Fox Contact is involved.



Workaround

If you really want to enable Emailcloaking plugin, you have to separate the form itself, from the text you are about to cloak.

Create two or more modules. A "Fox Contact" module and at least one "Custom HTML" module. Write your contact data and email addresses in the HTML module.
Assign the same position to everyone, (in the example I used "contact-form" as position) and pay attention to their ordering.


Create an article and call the modules above using the code "{loadposition contact-form}".


Enjoy your form surrounded by "Custom HTML" modules, containing cloaked email addresses.

Please Log in or Create an account to join the conversation.