Datastone obfuscate
Obfuscate an email or other strings to prevent spam-bots from sniffing it.
Usage
twig filter:
In the simplest form you can use
{{ "email@exemple.com" | obfuscate }}
Roadmap
- add other methods to obfucate email like text directions
- css and javascript tricks
More advance usage (which you probably wont need):
{{ string $str | [, obfuscate | obfuscateEmail | obfuscateMailTo] }}
craft extension:
{{ craft.dsObfuscate.obfuscate(string $str) }}
{{ craft.dsObfuscate.email(string $email) }}
{{ craft.dsObfuscate.mailto(string $email) }}
obfuscateMailTo:
{{ string $email | obfuscateMailTo([string $title [, $json ]]) }}
{{ craft.dsObfuscate.mailto(string $email [, string $title [, $json ]]) }}
example :
{{ 'exm@test.nl' | obfuscateMailTo('title', {'class' : 'className', 'attr' : ''}) }}
output :
<a href="mailto:exm@test.nl" class="className" attr>title</a>
string concat: (notice the () for twig otherwise the parsing goes wrong!)
{{ ('Some string to hide ' ~ foo.bar) | obfuscate }}
{{ craft.dsObfuscate.obfuscate('Some string to hide ' ~ foo.bar) }}
Installation Instructions
To install this plugin, copy the command above to your terminal.
Active Installs
12
License
MIT
Last release
February 3, 2023
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs